You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2018/06/28 18:24:11 UTC

[GitHub] eiri opened a new pull request #1419: Don't set context for compaction files during db delete

eiri opened a new pull request #1419: Don't set context for compaction files during db delete
URL: https://github.com/apache/couchdb/pull/1419
 
 
   ## Overview
   
   When we delete files with context option set to `delete`, `couch_file` respects configuration flag "enable_database_recovery" and just renames the files in case it's set to true.
   
   This change removes context for compaction files deleted during database deletion to make sure we are actually erasing them and not just renaming and leaving behind.
   
   ## Testing recommendations
   
   Change config `rel/overlay/etc/local.ini` and add into `[couchdb]` section 
   ```
   enable_database_recovery = true
   delete_after_rename = false
   ```
   Then run
   ```
   curl -X PUT http://127.0.0.1:15984/koi
   curl -X POST http://127.0.0.1:15984//koi/_compact
   curl -X DELETE http://127.0.0.1:15984/koi
   ```
   Check files in `./dev/lib/node1/data`, without this fix it should look something like:
   ```
   ...
   |   |-- nodes.couch
   |   `-- shards
   |       |-- 00000000-1fffffff
   |       |   |-- koi.1530196798.20180628.144003.deleted.couch
   |       |   |-- koi.1530196798.couch.compact.20180628.144003.deleted.data
   |       |   |-- koi.1530196798.couch.compact.20180628.144003.deleted.meta
   |       |   |-- koi.1530205729.20180628.170851.deleted.couch
   |       |   |-- koi.1530205729.couch.compact.20180628.170851.deleted.data
   |       |   `-- koi.1530205729.couch.compact.20180628.170851.deleted.meta
   |       |-- 20000000-3fffffff
   |       |   |-- koi.1530196798.20180628.144003.deleted.couch
   |       |   |-- koi.1530196798.couch.compact.20180628.144003.deleted.data
   |       |   |-- koi.1530196798.couch.compact.20180628.144003.deleted.meta
   |       |   |-- koi.1530205729.20180628.170851.deleted.couch
   |       |   |-- koi.1530205729.couch.compact.20180628.170851.deleted.data
   |       |   `-- koi.1530205729.couch.compact.20180628.170851.deleted.meta
   |       |-- 40000000-5fffffff
   ...
   ```
   
   With this change there shouldn't be `.deleted.data` and `.deleted.meta` leftovers.
   
   ## Checklist
   
   - [x] Code is written and works correctly;
   - [ ] Changes are covered by tests;
   - [ ] Documentation reflects the changes;
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services