Skip to content

fix(persistence): reload persisted records in store order like the Python agent - #60

Merged
rennf93 merged 1 commit into
masterfrom
fix/reload-no-sort
Oct 15, 2026
Merged

rennf93 merged 1 commit into
masterfrom
fix/reload-no-sort

Conversation

@rennf93

@rennf93 rennf93 commented Oct 15, 2026

Copy link
Copy Markdown
Member

Closes #59

I removed the keys.sort() from list_keys in RedisClientHandler and InMemoryRedisStore (src/persistence.rs). list_keys is only used by the startup reload, so reload now iterates keys in the order the store returns them, as the Python reference does (_load_events_from_redis / _load_metrics_from_redis). The reference only sorts on its limited clear path, which has no counterpart here (clearing is by explicit key or whole namespace). The InMemoryRedisStore::keys inspection helper stays sorted. The over-capacity handling on reload (evict the oldest buffered item before pushing) already matches the reference. The key stamp is SystemTime epoch nanoseconds, matching time.time_ns(). No docs claimed oldest-first reload, and no test assumed sorted reload.

Gate run locally: fmt, clippy -D warnings, tests (default and all features with --include-ignored against Redis), docs, MSRV 1.92 check and test, and the 100% line coverage gate all exit 0.

@github-actions github-actions Bot added the area: persistence Touches persistence, circuit breaker, or install id label Oct 15, 2026
@rennf93
rennf93 merged commit ecd344d into master Oct 15, 2026
11 checks passed
@rennf93
rennf93 deleted the fix/reload-no-sort branch October 15, 2026 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: persistence Touches persistence, circuit breaker, or install id

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reloading persisted records sorts the Redis keys, the Python agent does not

1 participant