Skip to content

[Redis 8.10] Add LMOVEM and BLMOVEM list commands - #3858

Merged
a-TODO-rov merged 8 commits into
mainfrom
lmovem-8.10
Jul 30, 2026
Merged

a-TODO-rov merged 8 commits into
mainfrom
lmovem-8.10

Conversation

@a-TODO-rov

@a-TODO-rov a-TODO-rov commented Jul 21, 2026 •

Copy link
Copy Markdown
Collaborator

Adds client support for the new LMOVEM and BLMOVEM commands (Redis 8.10), the multi-element counterparts of LMOVE/BLMOVE. Both move one or more elements between the head/tail of a source and destination list, with an optional COUNT/EXACTLY count and OBO/BULK ordering. The commands are exposed across the sync, async, reactive, and Kotlin coroutine APIs.

Key Decisions & Assumptions

  • Introduces a dedicated LMovemArgs rather than extending LMoveArgs, since the count block is meaningless for LMOVE/BLMOVE. When a count is set without an explicit ordering, it defaults to BULK.
  • BLMOVEM places timeout between the directions and the optional count block (per the command grammar), unlike BLMOVE where it trails; LMovemArgs splits direction/count building to support this.
  • Return type is List<V> (Flux<V> reactive), matching lpop(key, count). A nil reply — EXACTLY unsatisfiable, or a BLMOVEM timeout — surfaces as an empty list (empty Flux reactively), consistent with existing list commands rather than null.
  • Marked @since 7.8.

Behavioral / Conceptual Changes

  • New CommandType entries LMOVEM/BLMOVEM and CommandKeyword tokens EXACTLY/OBO/BULK.
  • Without a count block, lmovem/blmovem behave like lmove/blmove but return a single-element list.

Testing

Adds command-builder unit tests asserting the encoded argument order (including the BLMOVEM timeout placement and the BULK default). Adds integration tests covering plain moves, COUNT/EXACTLY with OBO and BULK ordering, and the unsatisfied-EXACTLY empty result; these run under sync, reactive, and a new RESP2 overload, and are gated with @EnabledOnCommand.


Note

Low Risk
Additive API and protocol support for new Redis commands; no changes to existing LMOVE/BLMOVE behavior beyond new methods and types.

Overview
Adds client support for Redis 8.10 LMOVEM and BLMOVEM, which atomically move one or more elements between lists (multi-element variants of LMOVE/BLMOVE).

New LMovemArgs and BLMovemArgs builders configure head/tail directions plus optional COUNT / EXACTLY with OBO or BULK ordering. BLMovemArgs is separate from LMovemArgs so blocking timeouts cannot be sent on the non-blocking command; for BLMOVEM, the timeout is encoded between directions and the count block (unlike BLMOVE, where timeout trails). Protocol adds LMOVEM/BLMOVEM and keywords EXACTLY, OBO, BULK.

lmovem / blmovem are wired through RedisCommandBuilder with ValueListOutput, exposed on sync, async, reactive (Flux<V>), Kotlin coroutines, and cluster node-selection APIs. Results are List<V>; nil/timeout/unsatisfied EXACTLY map to an empty list (empty Flux reactively), aligned with other multi-pop list commands. Without a count block, behavior matches single-element lmove/blmove but returns a one-element list.

Unit tests assert encoded argument order; integration tests cover moves, count ordering, EXACTLY failure, and BLMOVEM timeouts, gated with @EnabledOnCommand and duplicated under RESP2.

Reviewed by Cursor Bugbot for commit 0a2c145. Bugbot is set up for automated code reviews on this repo. Configure here.

@ggivo ggivo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

* @param args command arguments to configure source and destination directions and the optional count block.
* @param timeout the timeout in seconds.
* @return List&lt;V&gt; array-reply the elements being popped and pushed, or an empty list when the timeout was reached.
* @since 7.8

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current release is 7.6.
Are we planning another release before releasing the 8.10 command support?


CommandArgs<K, V> args = new CommandArgs<>(codec);
args.addKey(source).addKey(destination);
lMovemArgs.buildDirections(args);

@ggivo ggivo Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit strange.

with current approach we need to keep in mind if we add more options to LMovemArgs, they will not propagate automatically for the BLMOVEM command. command.

On the other hand, to resolve it, I see a few options, but each of them will require blmovem API to differ from the blmove API

A. Separate blocking args class.

  lmovem(K src, K dst, LMoveArgs directions, LMovemCountArgs count)                                                                                                                                        
  blmovem(K src, K dst, LMoveArgs directions, double timeout, LMovemCountArgs count)     

B. Move the timeout into the args object

   BLMovemArgs.Builder.leftRight().count(2, BULK).timeout(1.5)   // blocking variant                                                                                                                         
  blmovem(K source, K destination, BLMovemArgs args)             // no timeout param      

* @return List&lt;V&gt; array-reply the elements being popped and pushed, or an empty list when the timeout was reached.
* @since 7.8
*/
List<V> blmovem(K source, K destination, LMovemArgs args, double timeout);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i vote for a BLMovemArgs inheriting LMovemArgs

* @return List&lt;V&gt; array-reply the elements being popped and pushed, or an empty list when the timeout was reached.
* @since 7.8
*/
RedisFuture<List<V>> blmovem(K source, K destination, LMovemArgs args, double timeout);

@atakavci atakavci Jul 29, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about if command timesout is less than explicit timeout parameter. We should at least the explain the possible consequences if it is not something to solve in this PR.
BTW SE.Redis decided to not implement for blocking version due to the multiplexing nature of the core.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, not the version but the blocking variant of the command.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lettuce has already established the precedent that it supports blocking commands

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 292c353. Configure here.

@atakavci atakavci left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@a-TODO-rov
a-TODO-rov merged commit 8103b53 into main Jul 30, 2026
10 checks passed
@a-TODO-rov
a-TODO-rov deleted the lmovem-8.10 branch July 30, 2026 12:27
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.

4 participants