Skip to content

Commit 7c67510

Browse files
MatzeBfacebook-github-bot
authored andcommitted
fbcode/rocksdb/options.h
Differential Revision: D107676627
1 parent 7affaee commit 7c67510

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

db/db_impl/db_impl.cc

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,25 +1065,25 @@ void DBImpl::PrintStatistics() {
10651065
// various options.
10661066
// Returns 0 if all time-based compaction options are disabled.
10671067
static uint64_t GetMinTimeBasedCompactionInterval(
1068-
const ColumnFamilyOptions& cf_opts) {
1068+
const MutableCFOptions& mcf_opts) {
10691069
uint64_t min_interval = UINT64_MAX;
1070-
if (cf_opts.periodic_compaction_seconds > 0) {
1071-
min_interval = std::min(min_interval, cf_opts.periodic_compaction_seconds);
1070+
if (mcf_opts.periodic_compaction_seconds > 0) {
1071+
min_interval = std::min(min_interval, mcf_opts.periodic_compaction_seconds);
10721072
}
1073-
if (cf_opts.ttl > 0) {
1074-
min_interval = std::min(min_interval, cf_opts.ttl);
1073+
if (mcf_opts.ttl > 0) {
1074+
min_interval = std::min(min_interval, mcf_opts.ttl);
10751075
}
10761076
const auto& fifo_thresholds =
1077-
cf_opts.compaction_options_fifo.file_temperature_age_thresholds;
1077+
mcf_opts.compaction_options_fifo.file_temperature_age_thresholds;
10781078
if (!fifo_thresholds.empty() && fifo_thresholds[0].age > 0) {
10791079
// Thresholds are in increasing order by age, so first is smallest
10801080
min_interval = std::min(min_interval, fifo_thresholds[0].age);
10811081
}
1082-
if (cf_opts.bottommost_file_compaction_delay > 0) {
1082+
if (mcf_opts.bottommost_file_compaction_delay > 0) {
10831083
// NOTE: 0 does not exactly mean "disabled" in this case but it does mean
10841084
// there's no time component to the relevant compaction picking.
10851085
min_interval = std::min(min_interval,
1086-
uint64_t{cf_opts.bottommost_file_compaction_delay});
1086+
uint64_t{mcf_opts.bottommost_file_compaction_delay});
10871087
}
10881088
// Note: Assume sentinel values like UINT64_MAX - 1 (used by ttl and
10891089
// periodic_compaction_seconds) are like disabling, if they reach here
@@ -1115,7 +1115,7 @@ uint64_t DBImpl::ComputeTriggerCompactionPeriod() {
11151115
continue;
11161116
}
11171117
uint64_t cf_min =
1118-
GetMinTimeBasedCompactionInterval(cfd->GetLatestCFOptions());
1118+
GetMinTimeBasedCompactionInterval(cfd->GetLatestMutableCFOptions());
11191119
if (cf_min > 0) {
11201120
compaction_trigger_sec = std::min(compaction_trigger_sec, cf_min);
11211121
}
@@ -7863,7 +7863,8 @@ void DBImpl::TriggerPeriodicCompaction() {
78637863
// Check if this CF has any time-based or read-triggered compaction
78647864
// configured. This includes periodic_compaction_seconds, ttl, FIFO
78657865
// temperature thresholds, or read_triggered_compaction_threshold.
7866-
if (GetMinTimeBasedCompactionInterval(cfd->GetLatestCFOptions()) > 0 ||
7866+
if (GetMinTimeBasedCompactionInterval(cfd->GetLatestMutableCFOptions()) >
7867+
0 ||
78677868
cfd->GetLatestMutableCFOptions().read_triggered_compaction_threshold >
78687869
0.0) {
78697870
TEST_SYNC_POINT_CALLBACK(

0 commit comments

Comments
 (0)