feat: LINDEX, LSET, LTRIM, LINSERT, LREM, LPOS list commands#257
Merged
Conversation
adds the 6 missing list commands to the keyspace layer with full memory tracking and 30 new tests covering edge cases. - LINDEX: element by index with negative index support - LSET: replace element at index with memory delta tracking - LTRIM: keep only elements in range, auto-delete if empty - LINSERT: insert before/after a pivot element - LREM: remove N matches from head, tail, or all - LPOS: find element positions with rank, count, maxlen options
adds 6 command variants with their parsers. LPOS supports the full RANK/COUNT/MAXLEN option syntax with validation (rank != 0, count >= 0, maxlen >= 0). LINSERT parses BEFORE|AFTER direction.
- shard dispatch: 6 new ShardRequest variants + IntegerArray response - AOF persistence: 4 new record types (LSET, LTRIM, LINSERT, LREM) with binary serialization, deserialization, and recovery replay - connection handler: sharded + concurrent dispatch for all 6 commands with LPOS COUNT-aware response formatting (array vs single value) - replication: AofRecord → ShardRequest conversion for new variants - cluster: slot checking for all 6 single-key commands
also fix alphabetical ordering in generic and transactions groups.
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
fills critical list command gaps with 6 new commands: LINDEX, LSET, LTRIM, LINSERT, LREM, and LPOS. this completes the list data type coverage alongside the existing LPUSH/RPUSH/LPOP/RPOP/LRANGE/LLEN/BLPOP/BRPOP.
commands added:
full vertical slice per command:
what was tested
cargo buildclean across all cratesdesign considerations
value_sizesince the change is bulk. LINSERT usesenforce_memory_limitwith a defensive re-check after possible eviction of the target key itself.self.memory.*methods, avoiding Rust borrow checker conflicts betweenself.entriesandself.memory.