rocksdb/db/db_impl
Yanqin Jin dd203ed604 Disallow a combination of options (#9348)
Summary:
Disallow `immutable_db_opts.use_direct_io_for_flush_and_compaction == true` and
`mutable_db_opts.writable_file_max_buffer_size == 0`, since it causes `WritableFileWriter::Append()`
to loop forever and does not make much sense in direct IO.

This combination of options itself does not make much sense: asking RocksDB to do direct IO but not allowing
RocksDB to allocate a buffer. We should detect this false combination and warn user early, no matter whether
the application is running on a platform that supports direct IO or not. In the case of platform **not** supporting
direct IO, it's ok if the user learns about this and then finds that direct IO is not supported.

One tricky thing: the constructor of `WritableFileWriter` is being used in our unit tests, and it's impossible
to return status code from constructor. Since we do not throw, I put an assertion for now. Fortunately,
the constructor is not exposed to external applications.

Closing https://github.com/facebook/rocksdb/issues/7109

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

Test Plan: make check

Reviewed By: ajkr

Differential Revision: D33371924

Pulled By: riversand963

fbshipit-source-id: 2a3701ab541cee23bffda8a36cdf37b2d235edfa
2022-01-27 19:30:24 -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_compaction_flush.cc FlushMemTable return ok but memtable does not synchronize flush (#8173) 2022-01-12 13:21:49 -08:00
db_impl_debug.cc Fix flaky EventListenerTest.DisableBGCompaction (#9400) 2022-01-21 08:25:09 -08:00
db_impl_experimental.cc Get DBTest passing Assert Status Checked (#7737) 2021-12-09 11:00:17 -08:00
db_impl_files.cc Fix bug affecting GetSortedWalFiles, Backups, Checkpoint (#9208) 2021-11-24 14:52:00 -08:00
db_impl_open.cc Disallow a combination of options (#9348) 2022-01-27 19:30:24 -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 Add commit marker with timestamp (#9266) 2021-12-10 11:05:35 -08:00
db_impl_write.cc Added TraceOptions::preserve_write_order (#9334) 2021-12-28 15:04:26 -08:00
db_impl.cc Add checking for DB::DestroyColumnFamilyHandle() (#9347) 2022-01-05 20:26:53 -08:00
db_impl.h Make IncreaseFullHistoryTsLow to a public API (#9221) 2021-12-23 11:03:51 -08:00