-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
receive: fail early if ketama hashring is configured with number of nodes lower than the replication factor #6168
receive: fail early if ketama hashring is configured with number of nodes lower than the replication factor #6168
Conversation
de099b6
to
5bb16dc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @MichaHoffmann, this is looking nice!
I'm not sure why CircleCI is on strike again, I often see the run fails for first-time contributors, I'll try to see if we can fix it.
5bb16dc
to
3f4491d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good overall. Just some small nits about errors and assertions.
@@ -576,7 +579,10 @@ func testReceiveQuorum(t *testing.T, hashringAlgo HashringAlgorithm, withConsist | |||
}, | |||
} { | |||
t.Run(tc.name, func(t *testing.T) { | |||
handlers, hashring := newTestHandlerHashring(tc.appendables, tc.replicationFactor, hashringAlgo) | |||
handlers, hashring, err := newTestHandlerHashring(tc.appendables, tc.replicationFactor, hashringAlgo) | |||
if err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We usually use testutil.Ok
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I chose that to be consistent with the other assertions in this test. Its probably best to update all of them. While i'm at it should i also convert them to testutil.Ok
form?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's a good point, let's then leave it as it is for consistency.
a079830
to
36740b6
Compare
Signed-off-by: Michael Hoffmann <[email protected]>
7fbb9f6
to
75cc464
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work @MichaHoffmann 💪
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Addresses #5639
Changes
Construction of the ketama hashring can busyloop forever if less endpoints than replication factor was configured even briefly.
Verification
Added a unittest.