From 8717c268237aa1ba5928a941bc13cc84d9b6ce53 Mon Sep 17 00:00:00 2001 From: Kajetan Janiak Date: Thu, 7 Oct 2021 15:22:26 -0700 Subject: [PATCH] Warning about incompatible options with level_compaction_dynamic_level_bytes (#8329) Summary: This change introduces warnings instead of a silent override when trying to use level_compaction_dynamic_level_bytes with multiple cf_paths/db_paths. I have completed the CLA. Pull Request resolved: https://github.com/facebook/rocksdb/pull/8329 Reviewed By: hx235 Differential Revision: D31399713 Pulled By: ajkr fbshipit-source-id: 29c6fe5258d1f739b4590ecd44aee44f55415595 --- db/column_family.cc | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/db/column_family.cc b/db/column_family.cc index 8b7ca329e..b1cfa24f0 100644 --- a/db/column_family.cc +++ b/db/column_family.cc @@ -349,12 +349,18 @@ ColumnFamilyOptions SanitizeOptions(const ImmutableDBOptions& db_options, } if (result.level_compaction_dynamic_level_bytes) { - if (result.compaction_style != kCompactionStyleLevel || - result.cf_paths.size() > 1U) { - // 1. level_compaction_dynamic_level_bytes only makes sense for - // level-based compaction. - // 2. we don't yet know how to make both of this feature and multiple - // DB path work. + if (result.compaction_style != kCompactionStyleLevel) { + ROCKS_LOG_WARN(db_options.info_log.get(), + "level_compaction_dynamic_level_bytes only makes sense" + "for level-based compaction"); + result.level_compaction_dynamic_level_bytes = false; + } else if (result.cf_paths.size() > 1U) { + // we don't yet know how to make both of this feature and multiple + // DB path work. + ROCKS_LOG_WARN(db_options.info_log.get(), + "multiple cf_paths/db_paths and" + "level_compaction_dynamic_level_bytes" + "can't be used together"); result.level_compaction_dynamic_level_bytes = false; } }