-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
cli: fix alignment in node status
output
#27808
Conversation
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.
See issue for evidence of testing
Reviewable status: complete! 0 of 0 LGTMs obtained
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.
There are no tests for pkg/cli/node.go so I performed manual testing.
Reviewable status: complete! 0 of 0 LGTMs obtained
node status
outputnode status
output
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'm not confident the code is now correct. Concretely, I think you also have to add to decommissionStatuses
when the lop in line 204 decides not to hide the entry.
Could you pull out line 196-220 into a helper that you can then unit test?
b836fc8
to
9a651aa
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.
I've added UT for hideDecommission
function. The loop on line 204 didn't seem to affect it. One thing I have noticed is that node statuses that don't have a decommission status is valid (before this PR). Should I exclude such entries (node IDs 5 and 6 in the test)?
Reviewable status: complete! 0 of 0 LGTMs obtained
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 it's fine to print the nodes which don't have a decommission status. (That's better than removing them or erroring out).
Reviewed 2 of 2 files at r1.
Reviewable status: complete! 0 of 0 LGTMs obtained (and 1 stale)
@neeral can you please rebase your patch on the latest master branch. Currently it uses a submodule ref that doesn't exist any more. |
9a651aa
to
75305b1
Compare
I've rebased onto the latest release-2.0 branch. |
@knz this PR only merges against release-2.0. The code on |
75305b1
to
3c2e308
Compare
Yes sorry I meant release-2.0. |
@tschottdorf I'm not reviewing this further. If you're happy, feel free to merge. |
e2f9dfb
to
1d407ed
Compare
@neeral there's a flake in the decommission test:
You just have to change the test so that it accepts |
1d407ed
to
62f363a
Compare
bors r+ |
Build failed |
`cockroach node status` will hide decommissioning or dead nodes, unless the user requests all nodes to be shown. The data shown is collected from two different RPC calls and these do not line up. For example, a node's liveness will be put together with a different node's decommission status. To view this, decommission the node with NodeID 1 in a cluster. Run `cockroach node status --decommission` and `cockroach node status`. Look at the columns IsLive and UpdatedAt. You'll see they go out of sync. Release note: None
62f363a
to
d28ee73
Compare
thanks for the fix bors r+ |
Build failed |
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.
@knz @tschottdorf Bors keeps failing but when I run TC build it passes. Is there known flakiness here?
Most recently it failed on acceptance_test:TestJSONBUpgrade which is unrelated to changes I have made.
Could someone re-trigger bors?
Reviewable status: complete! 0 of 0 LGTMs obtained (and 1 stale)
bors r+ |
Timed out |
bors r+ |
Build failed |
bors r+ |
Build failed |
bors r+ |
27808: cli: fix alignment in `node status` output r=benesch a=neeral See #27807 `cockroach node status` will hide decommissioning or dead nodes, unless the user requests all nodes to be shown. The data shown is collected from two different RPC calls and these do not line up. For example, a node's liveness will be put together with a different node's decommission status. To view this, decommission the node with NodeID 1 in a cluster. Run `cockroach node status --decommission` and `cockroach node status`. Look at the columns IsLive and UpdatedAt. You'll see they go out of sync. Release note: None Co-authored-by: neeral <[email protected]>
Build succeeded |
See #27807
cockroach node status
will hide decommissioning or dead nodes, unlessthe user requests all nodes to be shown. The data shown is collected
from two different RPC calls and these do not line up. For example, a
node's liveness will be put together with a different node's
decommission status.
To view this, decommission the node with NodeID 1 in a cluster. Run
cockroach node status --decommission
andcockroach node status
. Lookat the columns IsLive and UpdatedAt. You'll see they go out of sync.
Release note: None