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
main
DorianZheng 6 years ago committed by Facebook Github Bot
parent 7487a7628c
commit e0f05754ba
  1. 1
      HISTORY.md
  2. 1
      db/db_impl_compaction_flush.cc
  3. 2
      include/rocksdb/listener.h

@ -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. * `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. * 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. * 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 ### 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. * TransactionOptions::skip_concurrency_control allows pessimistic transactions to skip the overhead of concurrency control. Could be used for optimizing certain transactions or during recovery.

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

@ -177,6 +177,8 @@ struct CompactionJobInfo {
explicit CompactionJobInfo(const CompactionJobStats& _stats) : explicit CompactionJobInfo(const CompactionJobStats& _stats) :
stats(_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. // the name of the column family where the compaction happened.
std::string cf_name; std::string cf_name;
// the status indicating whether the compaction was successful or not. // the status indicating whether the compaction was successful or not.

Loading…
Cancel
Save