Skip to content

Conversation

@vishesh
Copy link
Contributor

@vishesh vishesh commented Jul 17, 2019

RESOLVES #1840

@vishesh vishesh force-pushed the task/issue-1840-non-blocking-exclusion branch 3 times, most recently from 50ba9c2 to 4489f6f Compare July 17, 2019 01:21
@vishesh vishesh changed the title fdbcli: Add NO_WAIT option in exclude command to avoid blocking fdbcli: Add no_wait option in exclude command to avoid blocking Jul 17, 2019
@vishesh vishesh requested a review from ajbeamon July 18, 2019 01:39
} 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"
Copy link
Contributor

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.

Suggested change
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"

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

@vishesh vishesh requested a review from brownleej July 18, 2019 20:03
Copy link
Contributor

@brownleej brownleej left a comment

Choose a reason for hiding this comment

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

👍

@vishesh vishesh force-pushed the task/issue-1840-non-blocking-exclusion branch from 4489f6f to d9a8657 Compare July 19, 2019 19:08
@ajbeamon ajbeamon merged commit f6183df into apple:master Jul 19, 2019
@vishesh vishesh deleted the task/issue-1840-non-blocking-exclusion branch March 19, 2025 21:56
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.

Non-blocking exclusion command

3 participants