-
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 debug zip with new columns for cluster settings #107104
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.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @maryliag and @rharding6373)
pkg/cli/zip_table_registry.go
line 221 at r1 (raw file):
"crdb_internal.cluster_settings": { customQueryRedacted: `SELECT variable, value, type, public, description, default_value, origin FROM ( SELECT *
I'm actually more scared of this *
than the outer one. I think it would be better to replace both with explicit column names.
Previously, michae2 (Michael Erickson) wrote…
+1 Also, I think this reads more idiomatically without the unnecessary subquery and extra parens, but up to you:
|
5173754
to
7ffc88f
Compare
Previously, mgartner (Marcus Gartner) wrote…
Another option:
|
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 @michae2 and @rharding6373)
pkg/cli/zip_table_registry.go
line 221 at r1 (raw file):
Previously, mgartner (Marcus Gartner) wrote…
Another option:
SELECT variable, CASE WHEN type = 's' THEN '<redacted>' ELSE value END value, type, public, description, default_value, origin FROM crdb_internal.cluster_settings
duh... I did the fix, then remove just so I could test and check if the test was caughting the error and forgot to move back to the right location
7ffc88f
to
a008565
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 @michae2 and @rharding6373)
pkg/cli/zip_table_registry.go
line 221 at r1 (raw file):
Previously, maryliag (Marylia Gutierrez) wrote…
duh... I did the fix, then remove just so I could test and check if the test was caughting the error and forgot to move back to the right location
Fixed
a008565
to
68daa3b
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.
Reviewed 2 of 2 files at r1.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @maryliag, @michae2, and @rharding6373)
-- commits
line 18 at r1:
Can you mention that the crdb_internal.cluster_settings.txt
file in debug zips was empty due to this bug, and that it only affects v23.1.5?
68daa3b
to
9d296bf
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.
Reviewed all commit messages.
Reviewable status: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @maryliag, @mgartner, and @rharding6373)
pkg/cli/zip_table_registry.go
line 222 at r4 (raw file):
customQueryRedacted: `SELECT variable, CASE WHEN type = 's' THEN '<redacted>' ELSE value END value,
Since we're here anyway, I have another request: could we rewrite this item as:
CASE WHEN type = 's' AND value != default_value THEN '<redacted>' ELSE value END value,
9d296bf
to
6a5cb6d
Compare
The addition of new columns on cluster_settings view done on cockroachdb#104449 were causing debug zip fails to add the information from that table, since the query used to gather the information was doing a join and not considering the new columns. This commit updates the query to use the explicit columns, so even if new columns are added it won't be a problem in the future. It also adds tests for all custom querys used to generate the debug zip, so this type of issue would have been caught. The file `crdb_internal.cluster_settings.txt` in debug zips was empty due to this bug on v23.1.5 (only version affected by this bug). Fixes cockroachdb#107103 Release note (bug fix): Debug zip now are properly showing the information from cluster_settings. The file `crdb_internal.cluster_settings.txt` in debug zips was empty due to this bug on v23.1.5 (only version affected by this bug).
6a5cb6d
to
be8c5c1
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 (and 1 stale) (waiting on @mgartner, @michae2, and @rharding6373)
pkg/cli/zip_table_registry.go
line 222 at r4 (raw file):
Previously, michae2 (Michael Erickson) wrote…
Since we're here anyway, I have another request: could we rewrite this item as:
CASE WHEN type = 's' AND value != default_value THEN '<redacted>' ELSE value END value,
Done
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.
Reviewed 2 of 2 files at r5, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (and 1 stale) (waiting on @maryliag and @rharding6373)
TFTRs! |
Build succeeded: |
The addition of new columns on cluster_settings view done on #104449 were causing debug zip fails to add the information from that table, since the query used to gather the information was doing a join and not considering the new columns.
This commit updates the query to use the explicit columns, so even if new columns are added it won't be a problem in the future. It also adds tests for all custom querys used to generate the debug zip, so this type of issue would have been caught.
The file
crdb_internal.cluster_settings.txt
in debug zips wasempty due to this bug on v23.1.5 (only version affected by this bug).
Fixes #107103
Release note (bug fix): Debug zip now are properly showing the information from cluster_settings. The file
crdb_internal.cluster_settings.txt
in debug zips wasempty due to this bug on v23.1.5 (only version affected by this bug).