feat(cluster): add slot management and topology foundations - #31
Merged
Conversation
implements the core building blocks for redis cluster compatibility: - slots.rs: CRC16 hash function (redis-compatible), SlotMap for 16384 slot distribution, SlotRange for contiguous slot assignments, hash tag extraction for key co-location - topology.rs: NodeId (uuid-based), ClusterNode with roles and health, ClusterState for full cluster view, MOVED redirect generation, CLUSTER INFO and CLUSTER NODES output formatting - error.rs: ClusterError enum for MOVED, ASK, and other cluster errors all modules include comprehensive unit tests. the crc16 implementation is verified against known redis slot assignments.
adds CLUSTER subcommands and ASKING to the protocol layer: - CLUSTER INFO: returns cluster state (stub for now) - CLUSTER NODES: returns node list (stub for now) - CLUSTER SLOTS: returns slot distribution (stub for now) - CLUSTER KEYSLOT: computes hash slot for a key (fully working) - CLUSTER MYID: returns node id (stub for now) - ASKING: migration hint flag (no-op for now) integrates ember-cluster crate into ember-server for slot calculation. includes comprehensive tests for all new command parsing.
kacy
added a commit
that referenced
this pull request
Feb 11, 2026
feat(cluster): add slot management and topology foundations
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
implements the core building blocks for redis cluster compatibility:
this lays the foundation for gossip-based membership, raft consensus, and live slot migration.
what was tested
{tag}syntax)cargo clippy -- -D warningspassescargo test -p ember-cluster -p ember-protocolall 203+ tests passdesign considerations