From da1cf8a9bce32982f3a3b7d5a8902bfa5b5e4a57 Mon Sep 17 00:00:00 2001 From: Yueh-Hsuan Chiang Date: Tue, 29 Sep 2015 17:58:00 -0700 Subject: [PATCH] Add a missing check for deprecated options in options_helper.cc Summary: Add a missing check for deprecated options in options_helper.cc Test Plan: options_test Reviewers: sdong, anthony, IslamAbdelRahman, igor Reviewed By: igor Subscribers: dhruba, leveldb Differential Revision: https://reviews.facebook.net/D47793 --- util/options_helper.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/util/options_helper.cc b/util/options_helper.cc index d745d1c99..13d4a371f 100644 --- a/util/options_helper.cc +++ b/util/options_helper.cc @@ -665,6 +665,11 @@ Status GetStringFromDBOptions(std::string* opt_string, opt_string->clear(); for (auto iter = db_options_type_info.begin(); iter != db_options_type_info.end(); ++iter) { + if (iter->second.verification == OptionVerificationType::kDeprecated) { + // If the option is no longer used in rocksdb and marked as deprecated, + // we skip it in the serialization. + continue; + } std::string single_output; bool result = SerializeSingleDBOption(&single_output, db_options, iter->first, delimiter); @@ -703,6 +708,8 @@ Status GetStringFromColumnFamilyOptions(std::string* opt_string, for (auto iter = cf_options_type_info.begin(); iter != cf_options_type_info.end(); ++iter) { if (iter->second.verification == OptionVerificationType::kDeprecated) { + // If the option is no longer used in rocksdb and marked as deprecated, + // we skip it in the serialization. continue; } std::string single_output;