-
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
sql: Add per replica locality information to show ranges. #39813
Conversation
d6ed540
to
47ecc9f
Compare
Bump |
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.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @rohany and @solongordon)
pkg/sql/crdb_internal.go, line 1855 at r1 (raw file):
index_name STRING NOT NULL, replicas INT[] NOT NULL, replica_localities STRING[] NOT NULL,
Whitespace weirdness
pkg/sql/crdb_internal.go, line 1943 at r1 (raw file):
} var voterReplicaLocalities []string
Nit: This slice seems unnecessary. You can just append to replicaLocalityArr
as you iterate through voterReplicas
.
pkg/sql/show_ranges_test.go, line 53 at r1 (raw file):
expected := "{" for i, replica := range replicas { expected = expected + fmt.Sprintf("\"region=test,dc=dc%d\"", replica)
Nit: You can use +=
here. (In general strings.Builder
is better but unnecessary in a unit test.)
Also, you can use the backtick to avoid escaping double quotes: `"region=test,dc=dc%d"`
47ecc9f
to
d182d9f
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.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @solongordon)
pkg/sql/crdb_internal.go, line 1855 at r1 (raw file):
Previously, solongordon (Solon) wrote…
Whitespace weirdness
what is the rule for this -- is it always supposed to be spaces?? I get this wrong on every PR i send.
pkg/sql/crdb_internal.go, line 1943 at r1 (raw file):
Previously, solongordon (Solon) wrote…
Nit: This slice seems unnecessary. You can just append to
replicaLocalityArr
as you iterate throughvoterReplicas
.
Good catch.
pkg/sql/show_ranges_test.go, line 53 at r1 (raw file):
Previously, solongordon (Solon) wrote…
Nit: You can use
+=
here. (In generalstrings.Builder
is better but unnecessary in a unit test.)Also, you can use the backtick to avoid escaping double quotes:
`"region=test,dc=dc%d"`
Done
RFAL |
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.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @rohany and @solongordon)
pkg/sql/crdb_internal.go, line 1855 at r1 (raw file):
Previously, rohany (Rohan Yadav) wrote…
what is the rule for this -- is it always supposed to be spaces?? I get this wrong on every PR i send.
Yeah, I think spaces in strings, tabs for code. I always just match whatever the surrounding lines do. GoLand seems to get it right for me.
lol every error with spacing i have looks fine in goland :( |
Fixes cockroachdb#39793. Release note (sql change): Show ranges now displays per replica locality information.
d182d9f
to
32185e6
Compare
bors r=solongordon |
Build succeeded |
Fixes #39793.
Release note (sql change): Show ranges now displays per replica
locality information.