提交 a5adda06 编写于 作者: D Dmitri Smirnov 提交者: Facebook Github Bot

Fix repair issues

Summary:
Record the first parsed sequence number as the minimum
  so we can find the true minimum otherwise everything is larger than zero.
  Fix the comparator name comparision.
Closes https://github.com/facebook/rocksdb/pull/1858

Differential Revision: D4544365

Pulled By: ajkr

fbshipit-source-id: 439cbc2
上级 b48e4778
......@@ -486,6 +486,7 @@ class Repairer {
if (empty) {
empty = false;
t->meta.smallest.DecodeFrom(key);
t->min_sequence = parsed.sequence;
}
t->meta.largest.DecodeFrom(key);
if (parsed.sequence < t->min_sequence) {
......
......@@ -253,7 +253,10 @@ TEST_F(RepairTest, RepairColumnFamilyOptions) {
db_->GetPropertiesOfAllTables(handles_[1], &fname_to_props);
ASSERT_EQ(fname_to_props.size(), 2U);
for (const auto& fname_and_props : fname_to_props) {
ASSERT_EQ(InternalKeyComparator(rev_opts.comparator).Name(),
std::string comparator_name (
InternalKeyComparator(rev_opts.comparator).Name());
comparator_name = comparator_name.substr(comparator_name.find(':') + 1);
ASSERT_EQ(comparator_name,
fname_and_props.second->comparator_name);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册