-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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: add internal tables to expose status server info about the cluster #21427
cli: add internal tables to expose status server info about the cluster #21427
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.
Looks good! Thanks for doing this. LGTM after minor nits.
@@ -1613,8 +1621,8 @@ CREATE TABLE crdb_internal.gossip_nodes ( | |||
}, | |||
} | |||
|
|||
// crdbInternalGossipLiveness exposes local information about the nodes liveness. | |||
var crdbInternalGossipLiveness = virtualSchemaTable{ |
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.
nodes' liveness
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.
Shame on me. Fixed.
node_id network address attrs locality version | ||
1 tcp 127.0.0.1:<port> [] · <version> | ||
node_id network address attrs locality server_version | ||
1 tcp 127.0.0.1:<port> [] {} <server_version> | ||
|
||
query IITBB colnames | ||
SELECT node_id, epoch, regexp_replace(expiration, '^\d+\.\d+,\d+$', '<timestamp>') as expiration, draining, decommissioning FROM crdb_internal.gossip_liveness WHERE node_id = 1 | ||
---- | ||
node_id epoch expiration draining decommissioning | ||
1 1 <timestamp> false false | ||
|
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.
Could you add queries here and below that retrieve things like node_id, store_id, attrs, locality? Those should be static and so we'll see at least some data.
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.
Sure, implemented.
I was confused by the JSON fields. At the moment they are omitted from the tests.
pkg/sql/crdb_internal.go
Outdated
distribution STRING NOT NULL, | ||
type STRING NOT NULL, | ||
dependencies STRING NOT NULL, | ||
started_at INT NOT NULL, |
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.
TIMESTAMP
pkg/sql/crdb_internal.go
Outdated
type STRING NOT NULL, | ||
dependencies STRING NOT NULL, | ||
started_at INT NOT NULL, | ||
updated_at INT NOT NULL, |
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.
TIMESTAMP
metrics.Add(k, metric) | ||
} | ||
|
||
percentilesToJSON := func(ps roachpb.Percentiles) (json.JSON, error) { |
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.
@justinj do you think this code is good as is?
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.
Assuming it's reasonable that these columns are JSON in the first place (based on a quick glance it looks like it is) the code constructing them looks good to me!
Reviewed 2 of 4 files at r1, 2 of 2 files at r2. pkg/sql/crdb_internal.go, line 1745 at r2 (raw file):
pkg/sql/crdb_internal.go, line 1858 at r2 (raw file):
pkg/sql/logictest/testdata/logic_test/crdb_internal, line 243 at r2 (raw file):
pkg/sql/logictest/testdata/logic_test/crdb_internal, line 254 at r2 (raw file):
Remove Comments from Reviewable |
Fixes #20713. Release note: None
Great stuff, @dsaveliev! |
Fixes #20713.
Release note: None