Skip to content

Commit

Permalink
PS-7809: Add backward compatibilty after removing rdb_comparator and …
Browse files Browse the repository at this point in the history
…using RocksDB::BytewiseComparator instead
  • Loading branch information
inikep committed Feb 27, 2025
1 parent 29005f0 commit d20dc8e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions db/version_edit_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@ Status VersionEditHandler::ApplyVersionEdit(VersionEdit& edit,
}
if (s.ok()) {
assert(cfd != nullptr);
if (edit.comparator_ == "RocksDB_SE_v3.10")
edit.comparator_ = "leveldb.BytewiseComparator";
if (edit.comparator_ == "rev:RocksDB_SE_v3.10")
edit.comparator_ = "rocksdb.ReverseBytewiseComparator";
s = ExtractInfoFromVersionEdit(*cfd, edit);
}
return s;
Expand Down
5 changes: 5 additions & 0 deletions options/options_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,11 @@ Status RocksDBOptionsParser::Parse(const ConfigOptions& config_options_in,
if (!s.ok()) {
return s;
}
if (name == "comparator") {
if (value == "RocksDB_SE_v3.10") value = "leveldb.BytewiseComparator";
if (value == "rev:RocksDB_SE_v3.10")
value = "rocksdb.ReverseBytewiseComparator";
}
opt_map.insert({name, value});
}
}
Expand Down

0 comments on commit d20dc8e

Please sign in to comment.