chore: add debug printings to SetExisting (#4694)

Should help debugging #4672

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
Roman Gershman 2025-03-04 14:52:36 +02:00 committed by GitHub
parent ea6fdadd67
commit 028e08076a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -869,6 +869,19 @@ OpStatus SetCmd::SetExisting(const SetParams& params, DbSlice::Iterator it,
e_it->second = db_slice.FromAbsoluteTime(at_ms);
} else {
// Add new expiry information.
// Note: some consistency checks, following #4672. Once it's resolved we can remove them.
// -------------------------------------------------------------------------------------
ExpireTable* etable = db_slice.GetTables(op_args_.db_cntx.db_index).second;
ExpireIterator check_it = etable->Find(it->first.AsRef());
if (IsValid(check_it)) {
LOG(ERROR) << "Inconsistent state in SetCmd::SetExisting "
<< " key: " << key << ", "
<< "it.key:" << it.key() << ", "
<< "it->first:" << it->first.ToString()
<< " params.prev_val: " << params.prev_val << " " << params.flags;
}
// ------------------------------------------------
db_slice.AddExpire(op_args_.db_cntx.db_index, it, at_ms);
}
} else {