Skip to content

refactor: move slot hashing to ember-protocol, deprecate concurrent mode#358

Merged
kacy merged 1 commit into
mainfrom
cleanup/keyslot-dep-inversion
Jul 3, 2026
Merged

refactor: move slot hashing to ember-protocol, deprecate concurrent mode#358
kacy merged 1 commit into
mainfrom
cleanup/keyslot-dep-inversion

Conversation

@kacy

@kacy kacy commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Part 4 of a 5-PR cleanup series from a full-codebase audit.

What

  • Dependency inversion fixed: ember-core depended on all of ember-cluster — transitively compiling openraft, postcard, uuid, and hmac into the core engine — to call one function, key_slot(). The CRC16 table, hash-tag extraction, key_slot, and SLOT_COUNT now live in ember_protocol::slots (the leaf crate: bytes/itoa/memchr/thiserror only). ember-cluster re-exports both public names so nothing downstream changes; ember-core drops its ember-cluster dependency entirely. The Redis test vectors (CLUSTER KEYSLOT conformance) moved with the code.
  • Concurrent mode deprecated (per maintainer decision: deprecate first, remove later): startup warn! when --concurrent/EMBER_CONCURRENT is set, deprecation notes in ember.example.toml, helm values, ARCHITECTURE.md, and an unreleased CHANGELOG section. No code removed — the mode still works.

Verification

  • Full workspace: clippy -D warnings clean, 1,520 unit tests pass.
  • Ran ember-server --concurrent locally: the deprecation warning logs and the mode still serves traffic (healthcheck PING returns healthy).
  • Note: the CHANGELOG hunk may conflict trivially with chore: missing 0.4.9 changelog, de-flake timing tests, small cleanups #357 (both touch the top of the file); whichever lands second needs a one-line rebase.

ember-core depended on the entire ember-cluster crate (pulling openraft,
postcard, uuid, and hmac into the core engine's build) solely to call
key_slot(). The CRC16/hash-tag slot primitives are a property of the key,
not of cluster membership, so they now live in ember_protocol::slots —
the leaf crate both core and cluster already sit on top of.
ember-cluster re-exports key_slot and SLOT_COUNT, so its API is
unchanged; ember-core drops the ember-cluster dependency entirely.

concurrent mode (--concurrent / EMBER_CONCURRENT) is now deprecated:
the server logs a startup warning, and the example config, helm values,
and ARCHITECTURE.md are marked accordingly. The mode only accelerates
string commands, is mutually exclusive with cluster mode, and maintains
a ~2,900-line parallel connection handler; removal is planned for a
future release (0.4.8's changelog already believed it was gone).
@kacy kacy force-pushed the cleanup/keyslot-dep-inversion branch from c141dd7 to 10d2be5 Compare July 3, 2026 17:14
@kacy kacy merged commit f5aaad3 into main Jul 3, 2026
11 of 12 checks passed
@kacy kacy deleted the cleanup/keyslot-dep-inversion branch July 3, 2026 17:15
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