-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fdbcli: Add no_wait option in exclude command to avoid blocking
#1852
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
fdbcli: Add no_wait option in exclude command to avoid blocking
#1852
Conversation
50ba9c2 to
4489f6f
Compare
exclude command to avoid blockingno_wait option in exclude command to avoid blocking
fdbcli/fdbcli.actor.cpp
Outdated
| } else if (notExcludedServers.empty()) { | ||
| printf("\nIt is now safe to remove these machines or processes from the cluster.\n"); | ||
| } else { | ||
| printf("\nWARNING: Exclusion in progress. It is not safe to remove following machines or processes\n" |
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.
Not sure if this makes the line too long, so feel free to adjust if needed.
| printf("\nWARNING: Exclusion in progress. It is not safe to remove following machines or processes\n" | |
| printf("\nWARNING: Exclusion in progress. It is not safe to remove the following machines or processes\n" |
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.
Another thought -- this condition results in us returning true which I believe sets the is_error flag on the calling side. I'm not certain it's universally true, but in all cases I can think of where we trigger the error behavior, we also log an ERROR: message, and in cases where we log WARNING: we don't trigger error behavior. I wonder if it will be potentially confusing to combine a WARNING: message with the error behavior.
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 agree. In a way it's not really an error as well. I can simply return false like before. The output can be parsed to figure out if there are processes which are being excluded. (cc: @brownleej)
Also, is there a standard way to get information in JSON for such things about cluster? The original ticket suggested producing JSON which is good to have, but I couldn't find any other command doing so, and just putting some code/option for one specific command seemed inconsistent.
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.
Yes, we can parse the message on the calling side to figure out if there are still exclusions going. The only CLI command I'm aware of that produces JSON output is status json, but that's kind of a different case because it's getting the JSON serialization is handled inside the database, and the command is just reading the status/json key. I think a general flag for producing JSON output would be helpful, but I agree that doing it for one specific command is inconsistent, so maybe we should make that into its own issue.
Another case where we've added this kind of functionality is the fdbbackup tool, which has a --json flag for the status and describe commands.
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.
Cool. I will create a ticket for adding --json to fdbcli.
brownleej
left a comment
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.
👍
4489f6f to
d9a8657
Compare
RESOLVES #1840