New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FindObsoleteFiles should full scan after dropping CF #12087
base: main
Are you sure you want to change the base?
Conversation
When dropping CFs right after heavy write (flush and/or compaction was still ongoing), I observed that there were many sst files left forever unless restarting rocksdb. I checked manifest and those sst files were not there. It seems this issue was introduced since PR facebook#5275 (facebook#5275), as shutdown process can cleanup orphan/obsolete sst files, so no need to force a full scan when calling FindObsoleteFiles. However, dropping CF cannot cleanup those files and needs a full scan.
Hi @hengku! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
Thank you for reporting the issue and the proposed fix. Since SST files won't get deleted immediately after a column family is dropped. They will only be deleted after all outstanding |
Thank you for the follow up. Yes, I tried both DestroyColumnFamilyHandle and column family reset, but it didn't help. It seems those left-over sst files were not found by FindObsoleteFiles unless a full scan probably because of the following: the input/output sst files related to a compaction/flush will be associated with a version_set in manifest after that compaction/flush is completed successfully. However, if column families are dropped in the middle of that compaction/flush (failure case), those sst files might not be associated with a version_set correctly and become orphan files. |
Hi @jowlyzhang, this is my first PR to rocksdb community, may I know who would help to review it? Thank you! |
I can review this. We usually add a unit test to reproduce the exact issue getting fixed. I'm also checking this scenario to see if we can have a more targeted fix than doing a whole scan. |
got it, thank you @jowlyzhang |
When dropping CFs right after heavy write (flush and/or compaction was still ongoing), I observed that there were many sst files left forever unless restarting rocksdb. I checked manifest and those sst files were not there. It seems this issue was introduced since PR #5275, as shutdown process can cleanup orphan/obsolete sst files, so no need to force a full scan when calling FindObsoleteFiles. However, dropping CF cannot cleanup those files and needs a full scan.