Skip to content

refactor: move the AOF record to request converter into ember-core - #415

Merged
kacy merged 1 commit into
mainfrom
refactor/aof-record-converter
Sep 24, 2026
Merged

kacy merged 1 commit into
mainfrom
refactor/aof-record-converter

Conversation

@kacy

@kacy kacy commented Sep 24, 2026

Copy link
Copy Markdown
Owner

aof_record_to_shard_request turns an AofRecord into the ShardRequest that repeats its write. Replicas use it to apply the primary's stream. It lived in ember-server/src/replication.rs, while its inverse, to_aof_records, is in ember-core/src/shard/aof.rs.

It moves next to its inverse as ember_core::from_aof_record, with its two tests. Behavior is unchanged.

This prepares the next change: shard recovery will replay the AOF through this converter and the keyspace, instead of the separate replay in ember-persistence/src/recovery.rs, which repeats the effect of every write command against a HashMap.

aof_record_to_shard_request lived in the server's replication module,
while its inverse, to_aof_records, is in the shard. It is now
ember_core::from_aof_record next to it, so recovery can use it too.
@kacy
kacy merged commit 621676c into main Sep 24, 2026
12 checks passed
@kacy
kacy deleted the refactor/aof-record-converter branch September 24, 2026 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant