From 74ccd1931e226ac10fc9e0c03072098a8304727f Mon Sep 17 00:00:00 2001 From: Akanksha Mahajan Date: Fri, 28 Jan 2022 01:45:10 -0800 Subject: [PATCH] Remove deprecated option DBOptions::skip_log_error_on_recovery (#9434) Summary: In RocksDB DBOptions::skip_log_error_on_recovery is marked as "NOT SUPPORTED" for a long time, and setting this option does not have any effect on the behavior of RocksDB library. Therefore, we are removing it in the upcoming 7.0 release. Pull Request resolved: https://github.com/facebook/rocksdb/pull/9434 Test Plan: CircleCI Reviewed By: ajkr Differential Revision: D33763015 Pulled By: akankshamahajan15 fbshipit-source-id: 11f09643298da6c02d3dcdb090b996f4c3cfdd76 --- HISTORY.md | 1 + db/c.cc | 10 ---------- db/c_test.c | 8 -------- examples/rocksdb_option_file_example.ini | 2 +- include/rocksdb/c.h | 4 ---- include/rocksdb/options.h | 3 --- options/options_settable_test.cc | 1 - options/options_test.cc | 2 -- test_util/testutil.cc | 1 - tools/db_bench_tool_test.cc | 1 - 10 files changed, 2 insertions(+), 31 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 130a3b960a..5cae7ca5bb 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -16,6 +16,7 @@ * Remove deprecated API DBOption::base_background_compactions. * Remove deprecated API DBOptions::purge_redundant_kvs_while_flush. * Remove deprecated overloads of API DB::CompactRange. +* Remove deprecated option DBOptions::skip_log_error_on_recovery. ### Behavior Changes * Disallow the combination of DBOptions.use_direct_io_for_flush_and_compaction == true and DBOptions.writable_file_max_buffer_size == 0. This combination can cause WritableFileWriter::Append() to loop forever, and it does not make much sense in direct IO. diff --git a/db/c.cc b/db/c.cc index 50dd016b56..a260aa553d 100644 --- a/db/c.cc +++ b/db/c.cc @@ -3004,16 +3004,6 @@ unsigned char rocksdb_options_get_is_fd_close_on_exec(rocksdb_options_t* opt) { return opt->rep.is_fd_close_on_exec; } -void rocksdb_options_set_skip_log_error_on_recovery( - rocksdb_options_t* opt, unsigned char v) { - opt->rep.skip_log_error_on_recovery = v; -} - -unsigned char rocksdb_options_get_skip_log_error_on_recovery( - rocksdb_options_t* opt) { - return opt->rep.skip_log_error_on_recovery; -} - void rocksdb_options_set_stats_dump_period_sec( rocksdb_options_t* opt, unsigned int v) { opt->rep.stats_dump_period_sec = v; diff --git a/db/c_test.c b/db/c_test.c index fe5b2e24df..311687fc1f 100644 --- a/db/c_test.c +++ b/db/c_test.c @@ -1676,9 +1676,6 @@ int main(int argc, char** argv) { rocksdb_options_set_is_fd_close_on_exec(o, 1); CheckCondition(1 == rocksdb_options_get_is_fd_close_on_exec(o)); - rocksdb_options_set_skip_log_error_on_recovery(o, 1); - CheckCondition(1 == rocksdb_options_get_skip_log_error_on_recovery(o)); - rocksdb_options_set_stats_dump_period_sec(o, 18); CheckCondition(18 == rocksdb_options_get_stats_dump_period_sec(o)); @@ -1865,7 +1862,6 @@ int main(int argc, char** argv) { CheckCondition( 1 == rocksdb_options_get_use_direct_io_for_flush_and_compaction(copy)); CheckCondition(1 == rocksdb_options_get_is_fd_close_on_exec(copy)); - CheckCondition(1 == rocksdb_options_get_skip_log_error_on_recovery(copy)); CheckCondition(18 == rocksdb_options_get_stats_dump_period_sec(copy)); CheckCondition(5 == rocksdb_options_get_stats_persist_period_sec(copy)); CheckCondition(1 == rocksdb_options_get_advise_random_on_open(copy)); @@ -2135,10 +2131,6 @@ int main(int argc, char** argv) { CheckCondition(0 == rocksdb_options_get_is_fd_close_on_exec(copy)); CheckCondition(1 == rocksdb_options_get_is_fd_close_on_exec(o)); - rocksdb_options_set_skip_log_error_on_recovery(copy, 0); - CheckCondition(0 == rocksdb_options_get_skip_log_error_on_recovery(copy)); - CheckCondition(1 == rocksdb_options_get_skip_log_error_on_recovery(o)); - rocksdb_options_set_stats_dump_period_sec(copy, 218); CheckCondition(218 == rocksdb_options_get_stats_dump_period_sec(copy)); CheckCondition(18 == rocksdb_options_get_stats_dump_period_sec(o)); diff --git a/examples/rocksdb_option_file_example.ini b/examples/rocksdb_option_file_example.ini index 3d1eb17616..695200cadc 100644 --- a/examples/rocksdb_option_file_example.ini +++ b/examples/rocksdb_option_file_example.ini @@ -70,8 +70,8 @@ allow_fallocate=true error_if_exists=false recycle_log_file_num=0 - skip_log_error_on_recovery=false db_log_dir= + skip_log_error_on_recovery=false new_table_reader_for_compaction_inputs=true allow_mmap_reads=false allow_mmap_writes=false diff --git a/include/rocksdb/c.h b/include/rocksdb/c.h index 68690c15a8..36e36b7473 100644 --- a/include/rocksdb/c.h +++ b/include/rocksdb/c.h @@ -1256,10 +1256,6 @@ extern ROCKSDB_LIBRARY_API void rocksdb_options_set_is_fd_close_on_exec( rocksdb_options_t*, unsigned char); extern ROCKSDB_LIBRARY_API unsigned char rocksdb_options_get_is_fd_close_on_exec(rocksdb_options_t*); -extern ROCKSDB_LIBRARY_API void rocksdb_options_set_skip_log_error_on_recovery( - rocksdb_options_t*, unsigned char); -extern ROCKSDB_LIBRARY_API unsigned char -rocksdb_options_get_skip_log_error_on_recovery(rocksdb_options_t*); extern ROCKSDB_LIBRARY_API void rocksdb_options_set_stats_dump_period_sec( rocksdb_options_t*, unsigned int); extern ROCKSDB_LIBRARY_API unsigned int diff --git a/include/rocksdb/options.h b/include/rocksdb/options.h index b848d32da7..a87e8ca5f7 100644 --- a/include/rocksdb/options.h +++ b/include/rocksdb/options.h @@ -806,9 +806,6 @@ struct DBOptions { // Disable child process inherit open files. Default: true bool is_fd_close_on_exec = true; - // NOT SUPPORTED ANYMORE -- this options is no longer used - bool skip_log_error_on_recovery = false; - // if not zero, dump rocksdb.stats to LOG every stats_dump_period_sec // // Default: 600 (10 min) diff --git a/options/options_settable_test.cc b/options/options_settable_test.cc index 5bc1f8173c..96533745e3 100644 --- a/options/options_settable_test.cc +++ b/options/options_settable_test.cc @@ -285,7 +285,6 @@ TEST_F(OptionsSettableTest, DBOptionsAllFieldsSettable) { "skip_checking_sst_file_sizes_on_db_open=false;" "max_manifest_file_size=4295009941;" "db_log_dir=path/to/db_log_dir;" - "skip_log_error_on_recovery=true;" "writable_file_max_buffer_size=1048576;" "paranoid_checks=true;" "flush_verify_memtable_count=true;" diff --git a/options/options_test.cc b/options/options_test.cc index 2a8bd2e86c..7a1ec1e488 100644 --- a/options/options_test.cc +++ b/options/options_test.cc @@ -301,7 +301,6 @@ TEST_F(OptionsTest, GetOptionsFromMapTest) { ASSERT_EQ(new_db_opt.use_direct_reads, false); ASSERT_EQ(new_db_opt.use_direct_io_for_flush_and_compaction, false); ASSERT_EQ(new_db_opt.is_fd_close_on_exec, true); - ASSERT_EQ(new_db_opt.skip_log_error_on_recovery, false); ASSERT_EQ(new_db_opt.stats_dump_period_sec, 46U); ASSERT_EQ(new_db_opt.stats_persist_period_sec, 57U); ASSERT_EQ(new_db_opt.persist_stats_to_disk, false); @@ -2458,7 +2457,6 @@ TEST_F(OptionsOldApiTest, GetOptionsFromMapTest) { ASSERT_EQ(new_db_opt.use_direct_reads, false); ASSERT_EQ(new_db_opt.use_direct_io_for_flush_and_compaction, false); ASSERT_EQ(new_db_opt.is_fd_close_on_exec, true); - ASSERT_EQ(new_db_opt.skip_log_error_on_recovery, false); ASSERT_EQ(new_db_opt.stats_dump_period_sec, 46U); ASSERT_EQ(new_db_opt.stats_persist_period_sec, 57U); ASSERT_EQ(new_db_opt.persist_stats_to_disk, false); diff --git a/test_util/testutil.cc b/test_util/testutil.cc index 769e581f1b..47c128186f 100644 --- a/test_util/testutil.cc +++ b/test_util/testutil.cc @@ -335,7 +335,6 @@ void RandomInitDBOptions(DBOptions* db_opt, Random* rnd) { db_opt->is_fd_close_on_exec = rnd->Uniform(2); db_opt->paranoid_checks = rnd->Uniform(2); db_opt->track_and_verify_wals_in_manifest = rnd->Uniform(2); - db_opt->skip_log_error_on_recovery = rnd->Uniform(2); db_opt->skip_stats_update_on_db_open = rnd->Uniform(2); db_opt->skip_checking_sst_file_sizes_on_db_open = rnd->Uniform(2); db_opt->use_adaptive_mutex = rnd->Uniform(2); diff --git a/tools/db_bench_tool_test.cc b/tools/db_bench_tool_test.cc index 9edc8cfd52..12c0ede5ed 100644 --- a/tools/db_bench_tool_test.cc +++ b/tools/db_bench_tool_test.cc @@ -199,7 +199,6 @@ const std::string options_file_content = R"OPTIONS_FILE( skip_stats_update_on_db_open=false max_manifest_file_size=18446744073709551615 db_log_dir= - skip_log_error_on_recovery=false writable_file_max_buffer_size=1048576 paranoid_checks=true is_fd_close_on_exec=true