Context
Found during code review of bitmap implementation (commit e9be18b).
Problem
CommandExecutor has no verify_invariants() method. Data structure types like SDS and sorted sets have them, but the executor itself does not verify its aggregate state after mutations. This means:
data and expirations maps could diverge silently
access_times could contain stale entries
key_count field could drift from data.len()
Suggested Invariants
impl CommandExecutor {
#[cfg(debug_assertions)]
fn verify_invariants(&self) {
// Every key with expiration must exist in data
for key in self.expirations.keys() {
debug_assert!(self.data.contains_key(key));
}
// access_times should be subset of data keys
// (with allowance for recently-expired keys)
}
}
Call after every mutation in debug builds.
Severity
Low — design improvement, pre-existing gap across all executor ops.
Found By
TigerStyle review agent (Design observation)
Context
Found during code review of bitmap implementation (commit e9be18b).
Problem
CommandExecutorhas noverify_invariants()method. Data structure types likeSDSand sorted sets have them, but the executor itself does not verify its aggregate state after mutations. This means:dataandexpirationsmaps could diverge silentlyaccess_timescould contain stale entrieskey_countfield could drift fromdata.len()Suggested Invariants
Call after every mutation in debug builds.
Severity
Low — design improvement, pre-existing gap across all executor ops.
Found By
TigerStyle review agent (Design observation)