rocksdb/db/db_impl
Yanqin Jin 1e8322c0f5 Fix a bug in FlushJob picking more memtables beyond synced WALs (#9142)
Summary:
After RocksDB 6.19 and before this PR, RocksDB FlushJob may pick more memtables to flush beyond synced WALs.
This can be problematic if there are multiple column families, since it can prematurely advance the flushed column
family's log_number. Should subsequent attempts fail to sync the latest WALs and the database goes
through a recovery, it may detect corrupted WAL number below the flushed column family's log number
and complain about column family inconsistency.
To fix, we record the maximum memtable ID of the column family being flushed. Then we call SyncClosedLogs()
so that all closed WALs at the time when memtable ID is recorded will be synced.
I also disabled a unit test temporarily due to reasons described in https://github.com/facebook/rocksdb/issues/9151

Pull Request resolved: https://github.com/facebook/rocksdb/pull/9142

Test Plan: make check

Reviewed By: ajkr

Differential Revision: D32299956

Pulled By: riversand963

fbshipit-source-id: 0da75888177d91905cf8c9d00605b73afb5970a7
2021-11-19 09:56:00 -08:00
..
compacted_db_impl.cc Cleanup includes in dbformat.h (#8930) 2021-09-29 04:04:40 -07:00
compacted_db_impl.h Move compacted_db_impl.[c|h] to db/db_impl (#8082) 2021-03-23 13:49:26 -07:00
db_impl.cc Update TransactionUtil::CheckKeyForConflict to also use timestamps (#9162) 2021-11-15 12:52:18 -08:00
db_impl.h Update TransactionUtil::CheckKeyForConflict to also use timestamps (#9162) 2021-11-15 12:52:18 -08:00
db_impl_compaction_flush.cc Fix a bug in FlushJob picking more memtables beyond synced WALs (#9142) 2021-11-19 09:56:00 -08:00
db_impl_debug.cc Skip directory fsync for filesystem btrfs (#8903) 2021-11-03 12:21:27 -07:00
db_impl_experimental.cc Track per-SST user-defined timestamp information in MANIFEST (#9092) 2021-11-10 10:49:04 -08:00
db_impl_files.cc Skip directory fsync for filesystem btrfs (#8903) 2021-11-03 12:21:27 -07:00
db_impl_open.cc Track per-SST user-defined timestamp information in MANIFEST (#9092) 2021-11-10 10:49:04 -08:00
db_impl_readonly.cc Cleanup includes in dbformat.h (#8930) 2021-09-29 04:04:40 -07:00
db_impl_readonly.h RocksJava - Add errorIfLogFileExists parameter to RocksDB.openReadOnly (#7046) 2020-09-17 15:41:25 -07:00
db_impl_secondary.cc Cleanup includes in dbformat.h (#8930) 2021-09-29 04:04:40 -07:00
db_impl_secondary.h Cleanup includes in dbformat.h (#8930) 2021-09-29 04:04:40 -07:00
db_impl_write.cc Skip directory fsync for filesystem btrfs (#8903) 2021-11-03 12:21:27 -07:00