rocksdb/file
Zhongyi Xie d1c9ede195 Fix duplicated file names in PurgeObsoleteFiles (#5603)
Summary:
Currently in `DBImpl::PurgeObsoleteFiles`, the list of candidate files is create through a combination of calling LogFileName using `log_delete_files` and `full_scan_candidate_files`.

In full_scan_candidate_files, the filenames look like this
{file_name = "074715.log", file_path = "/txlogs/3306"},
but LogFileName produces filenames like this that prepends a slash:
{file_name = "/074715.log", file_path = "/txlogs/3306"},

This confuses the dedup step here: bb4178066d/db/db_impl/db_impl_files.cc (L339-L345)

Because duplicates still exist, DeleteFile is called on the same file twice, and hits an error on the second try. Error message: Failed to mark /txlogs/3302/764418.log as trash.

The root cause is the use of `kDumbDbName` when generating file names, it creates file names like /074715.log. This PR removes the use of `kDumbDbName` and create paths without leading '/' when dbname can be ignored.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/5603

Test Plan: make check

Differential Revision: D16413203

Pulled By: miasantreble

fbshipit-source-id: 6ba8288382c55f7d5e3892d722fc94b57d2e4491
2019-08-01 15:50:05 -07:00
..
delete_scheduler_test.cc simplify include directive involving inttypes (#5402) 2019-06-06 13:56:07 -07:00
delete_scheduler.cc Move some logging related files to logging/ (#5387) 2019-05-31 17:23:59 -07:00
delete_scheduler.h Move some file related files outside util/ (#5375) 2019-05-29 20:47:06 -07:00
file_util.cc Fix bugs in DBWALTest.kTolerateCorruptedTailRecords triggered by #5520 (#5550) 2019-07-09 11:18:32 -07:00
file_util.h Fix bugs in WAL trash file handling (#5520) 2019-07-06 21:07:32 -07:00
filename.cc Fix duplicated file names in PurgeObsoleteFiles (#5603) 2019-08-01 15:50:05 -07:00
filename.h Fix duplicated file names in PurgeObsoleteFiles (#5603) 2019-08-01 15:50:05 -07:00
sst_file_manager_impl.cc simplify include directive involving inttypes (#5402) 2019-06-06 13:56:07 -07:00
sst_file_manager_impl.h Organizing rocksdb/db directory 2019-05-31 11:57:01 -07:00