feat: proto command parsing and server wiring - #85
Merged
Conversation
add Command variants and from_frame() parsing for PROTO.REGISTER, PROTO.SET, PROTO.GET, PROTO.TYPE, PROTO.SCHEMAS, and PROTO.DESCRIBE. no feature gates in the protocol crate — these are just command definitions. PROTO.SET supports the same EX/PX/NX/XX options as SET.
add execute() handling for all six PROTO.* commands, gated behind the protobuf feature flag. PROTO.SET validates bytes against the schema registry before routing to the shard. PROTO.REGISTER broadcasts an AOF record to all shards for persistence. adds ProtoRegisterAof shard request variant so schema registrations are persisted through the existing AOF path. also adds proto key commands to cluster_slot_check for cluster mode routing.
when --protobuf is passed (or EMBER_PROTOBUF env var is set), the server creates a shared schema registry and wires it into the engine config. gated behind the protobuf feature flag.
kacy
added a commit
that referenced
this pull request
Feb 11, 2026
* feat: add proto command parsing to protocol crate add Command variants and from_frame() parsing for PROTO.REGISTER, PROTO.SET, PROTO.GET, PROTO.TYPE, PROTO.SCHEMAS, and PROTO.DESCRIBE. no feature gates in the protocol crate — these are just command definitions. PROTO.SET supports the same EX/PX/NX/XX options as SET. * feat: wire proto commands through server connection handler add execute() handling for all six PROTO.* commands, gated behind the protobuf feature flag. PROTO.SET validates bytes against the schema registry before routing to the shard. PROTO.REGISTER broadcasts an AOF record to all shards for persistence. adds ProtoRegisterAof shard request variant so schema registrations are persisted through the existing AOF path. also adds proto key commands to cluster_slot_check for cluster mode routing. * feat: add --protobuf CLI flag to enable proto commands when --protobuf is passed (or EMBER_PROTOBUF env var is set), the server creates a shared schema registry and wires it into the engine config. gated behind the protobuf feature flag. * chore: run cargo fmt
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
Commandvariants and RESP3 parsing for all sixPROTO.*commands (REGISTER,SET,GET,TYPE,SCHEMAS,DESCRIBE) to the protocol crate (no feature gates)execute()handler, gated behind#[cfg(feature = "protobuf")].PROTO.SETvalidates bytes against the schema registry before routing to the shard.PROTO.REGISTERbroadcasts an AOF record to all shards for persistence--protobufCLI flag (andEMBER_PROTOBUFenv var) to create a shared schema registry and enable proto commands at startupcluster_slot_check()for cluster-mode slot routingwhat was tested
cargo test --features protobuf— 310 tests pass, including 16 new command parsing tests covering all proto commands, flags (EX/PX/NX/XX), arity errors, and edge cases (zero expiry, NX+XX conflict)cargo test(no feature) — full suite passes, no regressionscargo clippy --features protobuf -- -D warnings— cleancargo clippy -- -D warnings— cleancargo fmt -- --check— cleandesign considerations
Commandvariants exist unconditionally so the parser doesn't need conditional compilation. the server handles the feature gate at execution timeProtoRegisterAofis a dedicated shard request variant that writes an AOF record without touching the keyspace. broadcast to all shards ensures any shard's AOF can recover the schema on restartstd::sync::RwLock(not tokio's) is used for the schema registry since lock hold times are very short (validation, name lookups). avoids async lock overhead on the hot path