提交 4cd96494 编辑于 作者: Yanqin Jin's avatar Yanqin Jin
浏览文件

Report corruption on unrecognized value type (#7121)

Summary:
During memtable lookup, an unrecognized value type should be reported as
Status::Corruption.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/7121

Test Plan: make check

Reviewed By: cheng-chang

Differential Revision: D22512124

Pulled By: riversand963

fbshipit-source-id: 9b97be7d9b230c5aae9205f96054420e5ea09066
上级 48bfca38
......@@ -766,7 +766,13 @@ static bool SaveValue(void* arg, const char* entry) {
}
return true;
}
default:
default: {
std::string msg("Unrecognized value type: " +
std::to_string(static_cast<int>(type)) + ". ");
msg.append("User key: " + user_key_slice.ToString(/*hex=*/true) + ". ");
msg.append("seq: " + std::to_string(seq) + ".");
*(s->status) = Status::Corruption(msg.c_str());
}
assert(false);
return true;
}
......
支持 Markdown
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册