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 1 commit
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
3 changes: 2 additions & 1 deletion commands/cluster-slots.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ 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. These active replicas are ordered deterministically.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we could just mention that the command response is deterministic across all nodes in a cluster. WDYT ?

Copy link
Member

@madolson madolson Jul 25, 2024

Choose a reason for hiding this comment

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

Also, should we clarify that they are ordered lexicographically?

Copy link
Member

Choose a reason for hiding this comment

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

I think we should. Because clients could check the result according to their ipaddress (becuase ipaddress as the first item in the result).

Copy link
Member Author

@roshkhatri roshkhatri Jul 25, 2024

Choose a reason for hiding this comment

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

I think we could just mention that the command response is deterministic across all nodes in a cluster

Do you mean at the start of the doc? like this

`CLUSTER SLOTS` returns details about which cluster slots map to which Valkey instances.
The command response is deterministic across all nodes in a cluster and is ordered lexicographically.

Copy link
Contributor

@hpatro hpatro Jul 25, 2024

Choose a reason for hiding this comment

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

I'm fine with placing it at the top.

Failed replicas are not returned.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we don't need a newline here.

Copy link
Contributor

Choose a reason for hiding this comment

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

@hpatro FYI, the recommendation is to have one sentence per line. The single linebreak doesn't have a semantic meaning in markdown so it will not be rendered as a linebreak, but if we change the text later, the diff will be per line so it's easier to see the diff if we do this. See the README of this repo: https://github.com/valkey-io/valkey-doc?tab=readme-ov-file#styling-guidelines


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.
Expand Down