Skip to content

Instantly share code, notes, and snippets.

@ajkr
Last active October 29, 2020 21:18
Show Gist options
  • Save ajkr/44df1c69e78629e91e7cf652661d8dc0 to your computer and use it in GitHub Desktop.
Save ajkr/44df1c69e78629e91e7cf652661d8dc0 to your computer and use it in GitHub Desktop.
// First, create a DB using 6.14 with #7612 applied.
$ rm -rf ./tmp-db && ./ldb put a b --db=./tmp-db --create_if_missing
OK
// Second, update to version number to 6.15 and stop serializing the option.
$ git diff
diff --git a/include/rocksdb/version.h b/include/rocksdb/version.h
index bf963d917..f9055d651 100644
--- a/include/rocksdb/version.h
+++ b/include/rocksdb/version.h
@@ -5,7 +5,7 @@
#pragma once
#define ROCKSDB_MAJOR 6
-#define ROCKSDB_MINOR 14
+#define ROCKSDB_MINOR 15
#define ROCKSDB_PATCH 0
// Do not use these. We made the mistake of declaring macros starting with
diff --git a/table/block_based/block_based_table_factory.cc b/table/block_based/block_based_table_factory.cc
index 9e789a6ec..a1d2a5507 100644
--- a/table/block_based/block_based_table_factory.cc
+++ b/table/block_based/block_based_table_factory.cc
@@ -240,7 +240,7 @@ static std::unordered_map<std::string, OptionTypeInfo>
{offsetof(struct BlockBasedTableOptions,
pin_l0_filter_and_index_blocks_in_cache),
OptionType::kBoolean, OptionVerificationType::kNormal,
- OptionTypeFlags::kNone}},
+ OptionTypeFlags::kDontSerialize}},
{"index_type", OptionTypeInfo::Enum<BlockBasedTableOptions::IndexType>(
offsetof(struct BlockBasedTableOptions, index_type),
&block_base_table_index_type_string_map)},
$ make -j48 ldb
$ ./ldb put a b --db=./tmp-db --try_load_options
OK
// Third, update the version to 7.0 and delete the option.
$ git diff
diff --git a/include/rocksdb/version.h b/include/rocksdb/version.h
index bf963d917..5e60bfe99 100644
--- a/include/rocksdb/version.h
+++ b/include/rocksdb/version.h
@@ -4,8 +4,8 @@
// (found in the LICENSE.Apache file in the root directory).
#pragma once
-#define ROCKSDB_MAJOR 6
-#define ROCKSDB_MINOR 14
+#define ROCKSDB_MAJOR 7
+#define ROCKSDB_MINOR 0
#define ROCKSDB_PATCH 0
// Do not use these. We made the mistake of declaring macros starting with
diff --git a/table/block_based/block_based_table_factory.cc b/table/block_based/block_based_table_factory.cc
index 9e789a6ec..9dfa2effa 100644
--- a/table/block_based/block_based_table_factory.cc
+++ b/table/block_based/block_based_table_factory.cc
@@ -236,11 +236,6 @@ static std::unordered_map<std::string, OptionTypeInfo>
cache_index_and_filter_blocks_with_high_priority),
OptionType::kBoolean, OptionVerificationType::kNormal,
OptionTypeFlags::kNone}},
- {"pin_l0_filter_and_index_blocks_in_cache",
- {offsetof(struct BlockBasedTableOptions,
- pin_l0_filter_and_index_blocks_in_cache),
- OptionType::kBoolean, OptionVerificationType::kNormal,
- OptionTypeFlags::kNone}},
{"index_type", OptionTypeInfo::Enum<BlockBasedTableOptions::IndexType>(
offsetof(struct BlockBasedTableOptions, index_type),
&block_base_table_index_type_string_map)},
$ make -j48 ldb
$ ./ldb put a b --db=./tmp-db --try_load_options
OK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment