Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cluster-slots to explain the deterministic ordering #159

Merged
merged 3 commits into from
Aug 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion commands/cluster-slots.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ Each nested result is:
- ...continues until all replicas for this master are returned.

Each result includes all active replicas of the master instance
for the listed slot range. Failed replicas are not returned.
for the listed slot range. Failed replicas are not returned.

madolson marked this conversation as resolved.
Show resolved Hide resolved
The command response is deterministic across all nodes in a cluster, which means that if two nodes return the same response they have the same view of the cluster.
Copy link
Contributor

Choose a reason for hiding this comment

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

This sentence is not per slot range, so I don't think it belongs under this section.

I would put this sentence at line 3, almost at the beginning of the page.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see that it was higher up earlier and was moved down by request by others. :) If it's not important enough to be at the top of the page, then maybe move it down further, to just before the example?

Primaries are ordered by the slots they serve and then replicas are ordered lexicographically by the node-id they were assigned by the cluster.
The third nested reply is guaranteed to be the networking information of the master instance for the slot range.
All networking information after the third nested reply are replicas of the master.

Comment on lines +40 to 43
Copy link
Contributor

Choose a reason for hiding this comment

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

Here, we're jumping between describing the primary, the replicas and the slot ranges.

This section is about a slot range, which is each line in the nested reply. Looking at the whole text from "Each result includes all active replicas of the master instance for the listed slot range" until the example below, I would start with describing the ordering of the slot ranges (including the sentence that explains that if a shard has non-contiguous slots, then the networking information is repeated for each range) and then say what the primary for this slot range is and that the replicas for this slot range are ordered lexicographically by node-id.

Rough idea:

Each result includes all active replicas of the primary instance for the listed slot range.
Failing replicas are not returned.

The slot ranges are returned in ascending order.
If a cluster shard serves non-contiguous slots (e.g. 1-400,900,1800-6000) then primary and replica networking information results are duplicated for each slot range.

The third nested reply is the networking information of the primary instance for the slot range.
All networking information after the third nested reply are replicas of the primary.
The replicas of each primary are ordered lexicographically by the node-id they were assigned by the cluster.

Expand Down