-
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: run node status
and node ls
commands through SQL
#25094
Conversation
Review status: 0 of 2 files reviewed at latest revision, all discussions resolved, some commit checks failed. a discussion (no related file):
Since I directly join the queries and print the result, pkg/cli/node.go, line 196 at r1 (raw file): Quoted 4 lines of code…
Earlier timeout were handled by passing a context with deadline since Comments from Reviewable |
node status
and node ls
commands through SQLnode status
and node ls
commands through SQL
Sorry for letting this sit, @Nishant9! Will take a look soon. |
Reviewed 2 of 2 files at r1. a discussion (no related file):
No, I think this is fine. Could you ping me when I should do the final review, after tests have been fixed up? pkg/cli/node.go, line 126 at r1 (raw file):
You could take a pkg/cli/node.go, line 196 at r1 (raw file): Previously, Nishant9 (Nishant Gupta) wrote…
If this works this is good for a first cut, we can file an issue with the Lines 45 to 48 in 28087d0
Comments from Reviewable |
Codecov Report
@@ Coverage Diff @@
## master #25094 +/- ##
=========================================
Coverage ? 76.83%
=========================================
Files ? 875
Lines ? 123657
Branches ? 0
=========================================
Hits ? 95006
Misses ? 21711
Partials ? 6940
Continue to review full report at Codecov.
|
Review status: 1 of 3 files reviewed at latest revision, 3 unresolved discussions. pkg/cli/node.go, line 126 at r1 (raw file): Previously, tschottdorf (Tobias Schottdorf) wrote…
I have to collect all the queries to be joined in a slice anyway. So, I thought there was no use unpacking and packing a slice. Comments from Reviewable |
Reviewed 2 of 2 files at r2. pkg/cli/node.go, line 126 at r1 (raw file): Previously, Nishant9 (Nishant Gupta) wrote…
This would make the population of Comments from Reviewable |
CI currently fails here. I hope this is just due to a change in format of the output there. Review status: all files reviewed at latest revision, 3 unresolved discussions, some commit checks failed. Comments from Reviewable |
c1037d7
to
d28b792
Compare
@tschottdorf This is ready for final review, I have fixed all the tests. |
Reviewed 2 of 2 files at r3. pkg/cli/node.go, line 145 at r3 (raw file):
Can't you just use pkg/cli/node.go, line 157 at r3 (raw file):
This looks weird in that you're comparing these lexicographically. This probably works since the length of timestamps rarely changes, but consider the two timestamps I think instead you can just strip the logical component and compare the rest as numbers (and yeah, this is all a bit awkward because we don't have a type for hybrid timestamps). Comments from Reviewable |
Review status: 2 of 3 files reviewed at latest revision, 5 unresolved discussions. pkg/cli/node.go, line 145 at r3 (raw file): Previously, tschottdorf (Tobias Schottdorf) wrote…
Comments from Reviewable |
pkg/cli/node.go, line 157 at r3 (raw file): Previously, tschottdorf (Tobias Schottdorf) wrote…
Done. Comments from Reviewable |
Earlier `node status` command used to hit statusServer api endpoint and `node ls` internally called `node status`. Now, `node status` and `node ls` commands internally query various tables in crdb_internal and format the result. Closes cockroachdb#20713. Release note: None
node status
and node ls
commands through SQLnode status
and node ls
commands through SQL
Thanks a bunch, @Nishant9! bors r+ Reviewed 1 of 1 files at r4. pkg/cli/node.go, line 145 at r3 (raw file): Previously, Nishant9 (Nishant Gupta) wrote…
You're right, sorry about the noise! Comments from Reviewable |
Filed #25435 about having context cancellation available for cli usage of SQL. |
Build failed (retrying...) |
25094: cli: run `node status` and `node ls` commands through SQL r=tschottdorf a=Nishant9 Earlier `node status` command used to hit statusServer api endpoint and `node ls` internally called `node status`. After this commit, `node status` and `node ls` commands will internally query various tables in crdb_internal and format the result. Closes #20713. Release note: None 25314: scripts: add a winworker script to create Windows VMs on GCE r=tschottdorf a=benesch It's quite useful to be able to quickly spin up a Windows VM to test our Windows binaries. Release note: None Co-authored-by: Nishant Gupta <[email protected]> Co-authored-by: Nikhil Benesch <[email protected]> Co-authored-by: Tobias Schottdorf <[email protected]>
Build succeeded |
Earlier
node status
command used to hit statusServer api endpoint andnode ls
internally called
node status
.After this commit,
node status
andnode ls
commands will internally query various tables incrdb_internal and format the result.
Closes #20713.
Release note: None