Merged
Conversation
add incr, decr, incr_by, incr_by_float with error types (ConcurrentOpError, ConcurrentFloatError) to ConcurrentKeyspace. these mirror the sharded keyspace's integer/float operations but operate directly on DashMap entries without channel overhead. also make format_float and glob_match pub(crate) in keyspace.rs for reuse in the concurrent module.
add append, strlen, persist, pexpire, pttl for string/TTL ops. add keys, scan_keys, rename for iteration and key management. all methods follow the same patterns as the sharded keyspace but operate directly on DashMap entries.
add match arms for INCR, DECR, INCRBY, DECRBY, INCRBYFLOAT, APPEND, STRLEN, PERSIST, PEXPIRE, PTTL in the concurrent handler. these dispatch directly to the new ConcurrentKeyspace methods, avoiding the shard channel round-trip.
…ndler MGET/MSET loop over existing get/set methods. TYPE always returns "string" since concurrent mode only stores string values. KEYS and SCAN iterate the DashMap directly. RENAME does remove+insert. INFO renders server/memory/stats/keyspace sections using the concurrent keyspace stats rather than broadcasting to shards.
kacy
added a commit
that referenced
this pull request
Feb 19, 2026
* feat: add arithmetic methods to concurrent keyspace add incr, decr, incr_by, incr_by_float with error types (ConcurrentOpError, ConcurrentFloatError) to ConcurrentKeyspace. these mirror the sharded keyspace's integer/float operations but operate directly on DashMap entries without channel overhead. also make format_float and glob_match pub(crate) in keyspace.rs for reuse in the concurrent module. * feat: add string and TTL helpers to concurrent keyspace add append, strlen, persist, pexpire, pttl for string/TTL ops. add keys, scan_keys, rename for iteration and key management. all methods follow the same patterns as the sharded keyspace but operate directly on DashMap entries. * feat: wire string/TTL commands into concurrent handler add match arms for INCR, DECR, INCRBY, DECRBY, INCRBYFLOAT, APPEND, STRLEN, PERSIST, PEXPIRE, PTTL in the concurrent handler. these dispatch directly to the new ConcurrentKeyspace methods, avoiding the shard channel round-trip. * feat: add MGET, MSET, TYPE, KEYS, SCAN, RENAME, INFO to concurrent handler MGET/MSET loop over existing get/set methods. TYPE always returns "string" since concurrent mode only stores string values. KEYS and SCAN iterate the DashMap directly. RENAME does remove+insert. INFO renders server/memory/stats/keyspace sections using the concurrent keyspace stats rather than broadcasting to shards.
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
concurrent mode previously only supported GET/SET/DEL/EXISTS/EXPIRE/TTL. this PR
adds the missing string and utility commands so concurrent mode has near-complete
coverage for string workloads.
new ConcurrentKeyspace methods:
incr,decr,incr_by,incr_by_floatwith proper error typesappend,strlenpersist,pexpire,pttlkeys,scan_keys,renamenew concurrent handler commands:
also made
format_floatandglob_matchpub(crate)in keyspace.rs for reuse.what was tested
cargo clippy --workspace --features protobuf -- -D warnings)design considerations
ConcurrentOpError,ConcurrentFloatError) are separate from the sharded keyspace'sIncrError/IncrFloatErrorbecause the concurrent keyspace only deals withBytesvalues, not theValueenum — there's noWrongTypevariant needed.incr_byusesget_mutto update in-place when possible, avoiding a full set+remove cycle.handles the expired-key edge case by removing the stale entry and treating the key as new.
render_concurrent_infois separate from the shardedrender_infosince it doesn't need tobroadcast to shards — it reads stats directly from the concurrent keyspace.