-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
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:
dataandexpirationsmaps could diverge silentlyaccess_timescould contain stale entrieskey_countfield could drift fromdata.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)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels