-
Notifications
You must be signed in to change notification settings - Fork 94
[restatectl] Add single-address mode #3631
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
Conversation
Are there still any restatectl operations that rely on finding and talking to a node with a particular role, like the cluster controller? |
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 hope this is considered as a short-term solution and wouldn't play as an excuse to defer removing the actual requirement altogether.
tools/restatectl/src/connection.rs
Outdated
@@ -9,6 +9,7 @@ | |||
// by the Apache License, Version 2.0. | |||
|
|||
use std::collections::{HashMap, HashSet}; | |||
use std::future::Future; |
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 this actually needed? Future should be in prelude in 2024 edition.
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.
No, my mistake! I didn't realise this is now in the prelude.
dddd817
to
9e3c519
Compare
There are! I made it nicer now - if we land on the wrong role, it will at least error out with something meaningful.
Definitely! I should have made that clearer. I wanted to get this merged as a short-term workaround for a customer who is operating in a restricted environment. |
9e3c519
to
5579641
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.
The changes looks good to me. There might be some operations that require landing on a certain role. But maybe metadata operations can always use a single address (no majority consensus). Hence a nice follow up can just use address
cli option, and only connect to a different node if we need that certain role?
Adds a new mode which bypasses cluster node enumeration, and instead talks only to a single specified address. This is helpful when the target nodes are behind a load balancer. In the fullness of time we'll move more of the intra-cluster comms behind the cluster control service, so direct connectivity won't be required, but this is a useful workaround to have in the meantime.
Landing on the wrong node (depending on the required role by the subcommand) is reported as an error. When targeting a load balancer, the nodes behind it are expected to be homogenous. If not then calls will fail spuriously:
/cc: @jackkleeman