diff --git a/HISTORY.md b/HISTORY.md index 2e6b4e99fd..a9446fbe1e 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -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. diff --git a/db/db_impl_compaction_flush.cc b/db/db_impl_compaction_flush.cc index eef8cf98de..79ecde6792 100644 --- a/db/db_impl_compaction_flush.cc +++ b/db/db_impl_compaction_flush.cc @@ -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(); diff --git a/include/rocksdb/listener.h b/include/rocksdb/listener.h index 46ce712dc5..e48642590b 100644 --- a/include/rocksdb/listener.h +++ b/include/rocksdb/listener.h @@ -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.