Expose column family id to OnCompactionCompleted (#4466)

Summary:
The controller you requested could not be found. PTAL
Pull Request resolved: https://github.com/facebook/rocksdb/pull/4466

Differential Revision: D10241358

Pulled By: yiwu-arbug

fbshipit-source-id: 99664eb286860a6c8844d50efeb0ef6f0e10dd1e
This commit is contained in:
DorianZheng 2018-10-08 14:21:23 -07:00 committed by Facebook Github Bot
parent 7487a7628c
commit e0f05754ba
3 changed files with 4 additions and 0 deletions

View file

@ -8,6 +8,7 @@
* `OnTableFileCreated` will now be called for empty files generated during compaction. In that case, `TableFileCreationInfo::file_path` will be "(nil)" and `TableFileCreationInfo::file_size` will be zero.
* Add `FlushOptions::allow_write_stall`, which controls whether Flush calls start working immediately, even if it causes user writes to stall, or will wait until flush can be performed without causing write stall (similar to `CompactRangeOptions::allow_write_stall`). Note that the default value is false, meaning we add delay to Flush calls until stalling can be avoided when possible. This is behavior change compared to previous RocksDB versions, where Flush calls didn't check if they might cause stall or not.
* Application using PessimisticTransactionDB is expected to rollback/commit recovered transactions before starting new ones. This assumption is used to skip concurrency control during recovery.
* Expose column family id to `OnCompactionCompleted`.
### New Features
* TransactionOptions::skip_concurrency_control allows pessimistic transactions to skip the overhead of concurrency control. Could be used for optimizing certain transactions or during recovery.

View file

@ -762,6 +762,7 @@ void DBImpl::NotifyOnCompactionCompleted(
TEST_SYNC_POINT("DBImpl::NotifyOnCompactionCompleted::UnlockMutex");
{
CompactionJobInfo info;
info.cf_id = cfd->GetID();
info.cf_name = cfd->GetName();
info.status = st;
info.thread_id = env_->GetThreadID();

View file

@ -177,6 +177,8 @@ struct CompactionJobInfo {
explicit CompactionJobInfo(const CompactionJobStats& _stats) :
stats(_stats) {}
// the id of the column family where the compaction happened.
uint32_t cf_id;
// the name of the column family where the compaction happened.
std::string cf_name;
// the status indicating whether the compaction was successful or not.