Skip to content

Conversation

@bjosv
Copy link
Collaborator

@bjosv bjosv commented Jan 23, 2025

"An empty endpoint indicates that the server node has an unknown endpoint, and the client should send the next request to the same endpoint as the current request but with the provided port."

https://valkey.io/topics/cluster-spec/

Copy link
Collaborator

@zuiderkwast zuiderkwast left a comment

Choose a reason for hiding this comment

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

The test case looks good. I didn't read all the details but it seems to work.

src/cluster.c Outdated
Comment on lines 1817 to 1824
if ((p = strchr(str, ' ')) != NULL)
*p = '\0';
switch (field++) {
// Skip field 0, i.e. ASK/MOVED
case 1: slot = str; break;
case 2: addr = str; break;
}
if (p == NULL) break; /* No more fields. */
Copy link
Collaborator

Choose a reason for hiding this comment

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

Here we check if p is NULL twice. Can we move the switch up and then just do one if-else for p == NULL?

@bjosv bjosv merged commit 5e212e6 into valkey-io:main Apr 25, 2025
47 checks passed
@bjosv bjosv deleted the empty-ip-in-redirects branch April 25, 2025 13:30
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.

2 participants