[Enhancement] add more print info when PersistentIndexMemtable meet duplicate key (#63560)

Signed-off-by: luohaha <18810541851@163.com>
This commit is contained in:
Yixin Luo 2025-09-26 15:53:32 +08:00 committed by GitHub
parent 13168ed2fc
commit 50bb386d2c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 2 deletions

View File

@ -61,8 +61,10 @@ Status PersistentIndexMemtable::insert(size_t n, const Slice* keys, const IndexV
auto old_index_value = old_index_value_ver.second;
if (old_index_value.get_value() != NullIndexValue) {
// shouldn't happen
std::string msg = strings::Substitute("PersistentIndexMemtable<$0> insert found duplicate key $1",
key.size(), hexdump((const char*)key.data(), key.size()));
std::string msg = strings::Substitute(
"PersistentIndexMemtable<$0> insert found duplicate key $1, old_val $2 old_ver $3 new_val $4",
key.size(), hexdump((const char*)key.data(), key.size()), old_index_value.get_value(),
old_index_value_ver.first, value.get_value());
LOG(ERROR) << msg;
if (!config::experimental_lake_ignore_pk_consistency_check) {
return Status::AlreadyExist(msg);