-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
chore: Remove ring client pool from JumpHashClientPool #14367
Conversation
pkg/bloomgateway/client_pool.go
Outdated
// ServerList deterministically maps keys to _index_ of the server list. | ||
// Since DNS returns records in different order each time, we sort to | ||
// guarantee best possible match between nodes. | ||
sort.Strings(servers) |
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.
Lexicographic sort isn't necessary here (and is incorrect for jumphash); jumphash needs natural sorting of servers so that z11
sorts after z2
. The call to SetServers
below will do a natural sort at the top of its implementation.
if err != nil { | ||
return nil, err | ||
} | ||
p.clients[addr] = client |
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.
Is it OK that nothing ever gets removed from p.clients
?
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 so. Worst thing is that we keep a couple of unused client objects around that are not actively used.
and replace it with a simpler implementation Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
4344ec1
to
4cc6b85
Compare
What this PR does / why we need it:
The ring client pool has functionality, such as periodic health checking of the servers and removing of stale clients, which is not needed in the JumpHashClientPool.
The removal of stale clients was problematic, because it compared the original server list (which is a list of CNAME records from the DNS lookup) with the client cache, which uses the IP of the server as key. Therefore it removed all cached clients on every check interval.
Special notes for your reviewer:
On the left side of the screenshot the index gateways use the current implementation of the client pool, then on the right side, the index gateways were updated to the new implementation. Cancelled requests are gone.
Checklist
CONTRIBUTING.md
guide (required)feat
PRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.docs/sources/setup/upgrade/_index.md
deprecated-config.yaml
anddeleted-config.yaml
files respectively in thetools/deprecated-config-checker
directory. Example PR