Skip to content

Commit 028e080

Browse files
authoredMar 4, 2025
chore: add debug printings to SetExisting (#4694)
Should help debugging #4672 Signed-off-by: Roman Gershman <[email protected]>
1 parent ea6fdad commit 028e080

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
 

‎src/server/string_family.cc

+13
Original file line numberDiff line numberDiff line change
@@ -869,6 +869,19 @@ OpStatus SetCmd::SetExisting(const SetParams& params, DbSlice::Iterator it,
869869
e_it->second = db_slice.FromAbsoluteTime(at_ms);
870870
} else {
871871
// Add new expiry information.
872+
873+
// Note: some consistency checks, following #4672. Once it's resolved we can remove them.
874+
// -------------------------------------------------------------------------------------
875+
ExpireTable* etable = db_slice.GetTables(op_args_.db_cntx.db_index).second;
876+
ExpireIterator check_it = etable->Find(it->first.AsRef());
877+
if (IsValid(check_it)) {
878+
LOG(ERROR) << "Inconsistent state in SetCmd::SetExisting "
879+
<< " key: " << key << ", "
880+
<< "it.key:" << it.key() << ", "
881+
<< "it->first:" << it->first.ToString()
882+
<< " params.prev_val: " << params.prev_val << " " << params.flags;
883+
}
884+
// ------------------------------------------------
872885
db_slice.AddExpire(op_args_.db_cntx.db_index, it, at_ms);
873886
}
874887
} else {

0 commit comments

Comments
 (0)
Please sign in to comment.