docs(persistence): add sync comment to AofRecord and improve recovery clarity - #165
Merged
Conversation
… clarity aof.rs - add a block comment on AofRecord impl explaining that tag(), estimated_size(), and to_bytes() must stay in sync when adding a variant. makes the constraint explicit for future contributors rather than leaving it implicit. recovery.rs - apply_incr: emit tracing::warn! when a value cannot be parsed as an integer during replay. previously this silently left the old value unchanged, giving operators no signal that the AOF contains unexpected data. - recover_shard_impl: add comment explaining TTL handling during recovery — that expired keys are filtered here and remaining-TTL keys are lazily evicted on first access after startup.
kacy
added a commit
that referenced
this pull request
Feb 19, 2026
… clarity (#165) aof.rs - add a block comment on AofRecord impl explaining that tag(), estimated_size(), and to_bytes() must stay in sync when adding a variant. makes the constraint explicit for future contributors rather than leaving it implicit. recovery.rs - apply_incr: emit tracing::warn! when a value cannot be parsed as an integer during replay. previously this silently left the old value unchanged, giving operators no signal that the AOF contains unexpected data. - recover_shard_impl: add comment explaining TTL handling during recovery — that expired keys are filtered here and remaining-TTL keys are lazily evicted on first access after startup.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
summary
two targeted clarity improvements to the persistence layer, no behavior changes.
aof.rs— sync comment onAofRecordAofRecordhas three match arms per variant that must be kept in sync:tag()(the tag byte),estimated_size()(capacity hint), andto_bytes()(actual serialization). there was no comment making this explicit. added a block comment on theimplexplaining the constraint and the requirement that tag byte values are never reused. this makes it harder for a future contributor to add a variant and miss one of the three arms.recovery.rs— warn on non-integer INCR replayapply_incrwas silently leaving a key's value unchanged when it encountered a non-integer during AOF replay. this meant that a corrupt or unexpected value in the AOF would produce no observable signal — the replay would succeed and the resulting keyspace would be silently wrong. now emitstracing::warn!so operators see the issue in logs.also added a comment on the TTL filtering step explaining that TTLs are preserved as-is during replay, that keys which expired during downtime are filtered at this point, and that keys with remaining TTL will be lazily evicted on first access.
what was tested
cargo build -p ember-persistence— cleancargo test -p ember-persistence— 67 tests pass, 0 failurescargo fmt --check -p ember-persistence— no formatting issues