CouchDB
  1. CouchDB
  2. COUCHDB-1358

Only delete files with .view extension

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.1.1
    • Fix Version/s: 1.2.1
    • Component/s: Database Core
    • Labels:
      None

      Description

      Currently all files in the view directory that are not used by any View group are deleted by the _view_cleanup endpoint. If other indexers (like GeoCouch) store indexes in the same directory, they get deleted as well.

      The attached patch changes the bahaviour and only deletes files ending with ".view". Leftovers from compaction are deletes as well as they end with ".compact.view".

        Activity

        Hide
        Volker Mische added a comment -

        Only delete files ending with ".view".

        Show
        Volker Mische added a comment - Only delete files ending with ".view".
        Hide
        Paul Joseph Davis added a comment -

        I haven't thought about it too hard, but I've been running under the assumption that indexers would just store their files in their own directories and be responsible for their own cleanup. Is there a good reason to munge these things together?

        Show
        Paul Joseph Davis added a comment - I haven't thought about it too hard, but I've been running under the assumption that indexers would just store their files in their own directories and be responsible for their own cleanup. Is there a good reason to munge these things together?
        Hide
        Volker Mische added a comment -

        The reason was simplicity. No new conf variable etc.

        With the indexer refactor (which is is trunk) it's not an issue anymore.

        I can fully understand if there's no good reason for CouchDB to apply this patch. But it made sense to have it tracked somewhere at least.

        Show
        Volker Mische added a comment - The reason was simplicity. No new conf variable etc. With the indexer refactor (which is is trunk) it's not an issue anymore. I can fully understand if there's no good reason for CouchDB to apply this patch. But it made sense to have it tracked somewhere at least.
        Hide
        Paul Joseph Davis added a comment -

        I'm not super against it by any means and was mostly thinking of the new indexers. If no one else objects I'll commit this.

        Show
        Paul Joseph Davis added a comment - I'm not super against it by any means and was mostly thinking of the new indexers. If no one else objects I'll commit this.
        Hide
        Adam Kocoloski added a comment -

        Seems harmless to me. Let's add it.

        Show
        Adam Kocoloski added a comment - Seems harmless to me. Let's add it.
        Hide
        Jason Smith added a comment -

        Paul makes a good point. However, it also seems reasonable that an indexer creates ".foo" files when it runs, and deletes ".foo" files when it cleans. Perhaps a site backup script is running, or rsync or something, placing siblings alongside the .view files. Cleanup shouldn't remove them either.

        Show
        Jason Smith added a comment - Paul makes a good point. However, it also seems reasonable that an indexer creates ".foo" files when it runs, and deletes ".foo" files when it cleans. Perhaps a site backup script is running, or rsync or something, placing siblings alongside the .view files. Cleanup shouldn't remove them either.
        Hide
        Paul Joseph Davis added a comment -

        Applied to 1.2.x and 1.1.x

        Show
        Paul Joseph Davis added a comment - Applied to 1.2.x and 1.1.x

          People

          • Assignee:
            Unassigned
            Reporter:
            Volker Mische
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development