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
This commit is contained in:
Yanqin Jin 2020-07-13 20:25:37 -07:00
parent 48bfca38f6
commit 4cd964946a

View File

@ -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;
}