Skip to content

Document atomic sorted-set moves and BYSCORE batch claims - #4522

Merged
dwdougherty merged 4 commits into
redis:feature-oss-8.12from
fcenedes:docs/zmove-commands
Nov 16, 2026
Merged

dwdougherty merged 4 commits into
redis:feature-oss-8.12from
fcenedes:docs/zmove-commands

Conversation

@fcenedes

@fcenedes fcenedes commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Documents the atomic sorted-set move commands merged in redis/redis#16135, using merged commit 0cfe83720 as the source of truth. Targets feature-oss-8.12 as requested.

Adds references for ZMOVE, BZMOVE and ZMOVEMEMBER, command catalog metadata, generated syntax diagrams, and a timestamp-scored batch-claim example in the sorted-set guide. Covers positive COUNT batching, nested/nil replies, counted MEMBERS with destination NX/XX conditions, score collisions, expiration handling, blocking, and same-slot requirements. The canonical named-member syntax is ZMOVEMEMBER source destination [NX | XX] MEMBERS num-members member [member ...]; the condition may also follow the complete block.

The final review clarifies BZMOVE timeout behavior, same-key type checking, the lack of expiration on a new destination, and protocol-neutral wording for the blocked producer example. Metadata and diagrams match the merged implementation.

Validation against the exact merged Redis commit:

  • Native warning-as-error build passed.
  • All 28 displayed CLI command/output examples and the blocked producer example passed.
  • 20 edge/protocol checks passed, covering type-check order, timeout, MULTI/Lua no-block behavior, NX/XX no-ops, destination TTL, and RESP2/RESP3 score/null types.
  • Live COMMAND DOCS/INFO match the catalog and frontmatter. Generated diagrams and all 25 internal links/anchors in the new content passed.
  • Full Hugo Extended 0.143.1 build passed: 21,329 pages. The final wording is present in rendered HTML. Existing unrelated site warnings remain; none concern the new command pages.
  • git diff --check passed.

The PR contains only the eight intended documentation files and is ready for review.

@CLAassistant

CLAassistant commented Nov 9, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@dwdougherty

dwdougherty commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

Thank you @fcenedes. Please change the target of this PR to the feature-oss-8.12 branch.

@dwdougherty dwdougherty added cmds oss Redis Open Source labels Nov 9, 2026
@dwdougherty
dwdougherty self-requested a review November 9, 2026 21:48
@fcenedes
fcenedes changed the base branch from main to feature-oss-8.12 November 10, 2026 08:35
@fcenedes

Copy link
Copy Markdown
Contributor Author

Thank you @fcenedes. Please change the target of this PR to the feature-oss-8.12 branch.

done sir

@fcenedes
fcenedes force-pushed the docs/zmove-commands branch from 415c0ee to 8686eef Compare November 10, 2026 08:42
@fcenedes
fcenedes marked this pull request as ready for review November 10, 2026 08:43

fcenedes commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor Author

Final review complete against the merged implementation in redis/redis#16135 (0cfe83720).

Pushed 1cb3bc4 to clarify BZMOVE timeout behavior, same-key type checking, new-destination expiration, and the protocol-neutral blocked producer example. Syntax, metadata, and diagrams match the merged contract.

Built the exact merged Redis source with warnings treated as errors. All 28 displayed CLI examples plus the blocked producer example pass, along with edge/protocol checks and live metadata validation. The full Hugo build passes (21,329 pages), and all 25 internal links/anchors in the new content resolve. The final wording is verified in rendered HTML.

The PR remains ready for review against feature-oss-8.12, with only the eight intended documentation files.

@dwdougherty

Copy link
Copy Markdown
Collaborator

Thank you @fcenedes. Please change the target of this PR to the feature-oss-8.12 branch.

done sir

Thank you, @fcenedes!

sundb added a commit to redis/redis that referenced this pull request Nov 11, 2026
…16135)

Adds atomic sorted-set moves for end-of-set batches, score ranges and
named members. Continues #10430 by @vikeychen. Related: #9989. Docs:
redis/docs#4522.

```text
ZMOVE        source destination <MIN | MAX | BYSCORE score-min score-max> [COUNT count]
BZMOVE       source destination <MIN | MAX> timeout [COUNT count]
ZMOVEMEMBER  source destination [NX | XX] MEMBERS num-members member [member ...]
```

### Reply

- When members are moved, the reply is an array of `[member, score]`
pairs, nested even for one member. Scores are bulk strings in RESP2 and
doubles in RESP3.
- When nothing is moved, the reply is nil (RESP2 `*-1`, RESP3 `_`). That
covers a missing source, no matching or eligible member, source ==
destination, and a BZMOVE timeout. It also covers BZMOVE inside MULTI or
a script when the source is empty.
- Reply order:
  - MIN and BYSCORE: ascending (score, then member);
  - MAX: descending;
- ZMOVEMEMBER: argument order, with duplicates once and missing members
skipped.

### Semantics

- `COUNT` must be positive. Zero, negative or malformed values return
`ERR count should be greater than 0` before anything moves or blocks, as
ZMPOP does. The default count is 1 for MIN/MAX. BYSCORE moves the whole
matching range by default.
- `BYSCORE` takes ZRANGEBYSCORE-style bounds (`(`, `-inf`, `+inf`). It
has no LIMIT offset.
- `BZMOVE` blocks on the source only. It wakes as soon as the source has
a member and moves up to COUNT; it doesn't wait for a full batch. When
members are moved, it is propagated as `ZMOVE source destination MIN|MAX
[COUNT count]`.
- `ZMOVEMEMBER`:
- The counted `MEMBERS` block keeps member data apart from options, like
HSETEX `FIELDS`. NX/XX may appear before or after the block, so a member
named `NX` or `MEMBERS` is unambiguous.
- With NX, only members absent from the destination move; with XX, only
members already present there move. Members that aren't moved stay in
the source.
- With no condition, the source score overwrites the destination score.
- Source == destination returns nil right after the type check, without
reading any member. BZMOVE does not block in that case.
- An emptied source is deleted. An existing destination keeps its TTL; a
new destination has none. In cluster mode both keys must hash to the
same slot.

### Keyspace notifications

These fire only when at least one member moved:

- Source:
  - `zpopmin` / `zpopmax` for MIN/MAX;
  - `zrem` for BYSCORE and ZMOVEMEMBER;
  - `del` when the source is emptied.
- Destination: `zadd`, but only if the destination actually changed.
Moving a member that already has the same score doesn't count as a
change. A newly created destination also gets `new`.

---------

Co-authored-by: vikeychen <[email protected]>
Co-authored-by: debing.sun <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
@fcenedes

Copy link
Copy Markdown
Contributor Author

Final state - no more updates from me. Based on the merged PR

@dwdougherty dwdougherty 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.

Thank you, @fcenedes! Approved, and I'll go ahead and merge into my feature branch.

@dwdougherty
dwdougherty merged commit 8b3b1e7 into redis:feature-oss-8.12 Nov 16, 2026
4 checks passed
dwdougherty added a commit that referenced this pull request Nov 23, 2026
* DEV: (feat/cmds) docs for CMS enhancements in 8.12 (#3953)

* DEV: (feat/cmds) docs for blessed keys in 8.12 (#4012)

* Document aof_cmd_duration in INFO persistence (#4006)

Co-authored-by: Cursor <[email protected]>

* DEV: docs for HNSW compression in 8.12 (#4106)

* DEV: docs for HNSW compression in 8.12

* Apply review suggestion

Clarified that disk-based vector indexes ignore both COMPRESSION and TRAINING_THRESHOLD.

* DEV: (feat) docs for streams observability metrics MVP in 8.12 (#4140)

* DEV: (feat) docs for streams observability metrics MVP in 8.12

* Update content/develop/data-types/streams/_index.md

Co-authored-by: mich-elle-luna <[email protected]>

---------

Co-authored-by: mich-elle-luna <[email protected]>

* DEV: (cmds) JSON: auto-create deep paths in 8.12 (#4257)

* DEV: (cmds) JSON: auto-create deep paths in 8.12

* Apply review comments.

Co-authored-by: andy-stark-redis <[email protected]>

---------

Co-authored-by: andy-stark-redis <[email protected]>

* DEV: (cmds) docs for new INFO command streams section (#4274)

* DEV: (cmds) docs for new INFO command streams section

* Apply review comments.

Co-authored-by: andy-stark-redis <[email protected]>

---------

Co-authored-by: andy-stark-redis <[email protected]>

* OP: add docs for named TLS in 8.12 (#4289)

* Document native Roaring bitmaps for Redis 8.12 (#3715)

* Document native Roaring bitmaps

* Keep Roaring details in bitmap guide

* Target Roaring bitmap docs to Redis 8.12

* Clarify native bitmap replication docs

Signed-off-by: Antonio Viggiano <[email protected]>

* Document native bitmap integer arrays and benchmark methodology

* Clarify bitmap rank argument validation order

* Regenerate bitmap command references and clarify internal replay

* Document internal bitmap replay commands

* Document consolidated bitmap integer-array command

* Clarify the consolidated bitmap integer-array command

* Document bitmap range validation before key lookup

* Change warning format in bitmaps documentation

Updated warning syntax for Roaring bitmap creation instructions.

---------

Signed-off-by: Antonio Viggiano <[email protected]>
Co-authored-by: David Dougherty <[email protected]>

* DEV: update modules API page for 8.12 release (#4306)

* DEV: update modules API page for 8.12 release

* Apply batched suggestions from code review

Co-authored-by: mich-elle-luna <[email protected]>

---------

Co-authored-by: mich-elle-luna <[email protected]>

* Document BITRANGEINTARRAY offset ranges, ZEROS, and pagination (#4304)

* Document negative bitmap ranks and the shared range limit

* Document bitmap range validation after key lookup

* Document uncapped bitmap enumeration and range truncation

* Document conditional string reads for BITRANGEINTARRAY

* Document bitmap value selection, offset ranges, and LIMIT pagination

* Align BITRANGEINTARRAY docs with merged ZEROS syntax

* DEV: (cmds) docs for set member expiration in 8.12 (#4337)

* DEV: (cmds) docs for set member expiration in 8.12

* Apply changes from review.

* Apply changes from upstream merge commit

* DEV: add redis-8-12-commands.md page (#4421)

* DEV: add 8.12 what's new page (#4422)

* OP: update OSS version management page for 8.12 (#4423)

* DEV: update data/commands_core.json from 8.12 GA build (#4436)

* Remove 8.12 release notes; point to redis/redis repo

* Document atomic sorted-set moves and BYSCORE batch claims (#4522)

* Document sorted-set move batches and destination conditions

* Document positive COUNT validation for sorted-set moves

* Document the ZMOVEMEMBER MEMBERS block

* Clarify final BZMOVE behavior after core merge

* Add new sorted set cmds to summary page

* Update module API page

* Update what's new for features added in 8.12-rc3

* Add compat. info to new sorted set commands

* Modify ACL categories for two bless commands

* Update config page to point to 8.12 config

---------

Signed-off-by: Antonio Viggiano <[email protected]>
Co-authored-by: yinon-bit <[email protected]>
Co-authored-by: Cursor <[email protected]>
Co-authored-by: mich-elle-luna <[email protected]>
Co-authored-by: andy-stark-redis <[email protected]>
Co-authored-by: Antonio Viggiano <[email protected]>
Co-authored-by: fcenedes <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cmds oss Redis Open Source

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants