Skip to content

Commit

Permalink
cli: add system.job_info to debug zip
Browse files Browse the repository at this point in the history
We do not dump the value column when
collecting a redacted zip as it might contain
sensitive data.

Release note: None
Informs: #98829
  • Loading branch information
adityamaru committed Apr 7, 2023
1 parent 64903e1 commit 923cbc4
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/cli/testdata/zip/partial1
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ debug zip --concurrency=1 --cpu-profile-duration=0s /dev/null
[cluster] retrieving SQL data for system.descriptor... writing output: debug/system.descriptor.txt... done
[cluster] retrieving SQL data for system.eventlog... writing output: debug/system.eventlog.txt... done
[cluster] retrieving SQL data for system.external_connections... writing output: debug/system.external_connections.txt... done
[cluster] retrieving SQL data for system.job_info... writing output: debug/system.job_info.txt... done
[cluster] retrieving SQL data for system.jobs... writing output: debug/system.jobs.txt... done
[cluster] retrieving SQL data for system.lease... writing output: debug/system.lease.txt... done
[cluster] retrieving SQL data for system.locations... writing output: debug/system.locations.txt... done
Expand Down
1 change: 1 addition & 0 deletions pkg/cli/testdata/zip/partial1_excluded
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ debug zip /dev/null --concurrency=1 --exclude-nodes=2 --cpu-profile-duration=0
[cluster] retrieving SQL data for system.descriptor... writing output: debug/system.descriptor.txt... done
[cluster] retrieving SQL data for system.eventlog... writing output: debug/system.eventlog.txt... done
[cluster] retrieving SQL data for system.external_connections... writing output: debug/system.external_connections.txt... done
[cluster] retrieving SQL data for system.job_info... writing output: debug/system.job_info.txt... done
[cluster] retrieving SQL data for system.jobs... writing output: debug/system.jobs.txt... done
[cluster] retrieving SQL data for system.lease... writing output: debug/system.lease.txt... done
[cluster] retrieving SQL data for system.locations... writing output: debug/system.locations.txt... done
Expand Down
1 change: 1 addition & 0 deletions pkg/cli/testdata/zip/partial2
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ debug zip --concurrency=1 --cpu-profile-duration=0 /dev/null
[cluster] retrieving SQL data for system.descriptor... writing output: debug/system.descriptor.txt... done
[cluster] retrieving SQL data for system.eventlog... writing output: debug/system.eventlog.txt... done
[cluster] retrieving SQL data for system.external_connections... writing output: debug/system.external_connections.txt... done
[cluster] retrieving SQL data for system.job_info... writing output: debug/system.job_info.txt... done
[cluster] retrieving SQL data for system.jobs... writing output: debug/system.jobs.txt... done
[cluster] retrieving SQL data for system.lease... writing output: debug/system.lease.txt... done
[cluster] retrieving SQL data for system.locations... writing output: debug/system.locations.txt... done
Expand Down
1 change: 1 addition & 0 deletions pkg/cli/testdata/zip/testzip
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ debug zip --concurrency=1 --cpu-profile-duration=1s /dev/null
[cluster] retrieving SQL data for system.descriptor... writing output: debug/system.descriptor.txt... done
[cluster] retrieving SQL data for system.eventlog... writing output: debug/system.eventlog.txt... done
[cluster] retrieving SQL data for system.external_connections... writing output: debug/system.external_connections.txt... done
[cluster] retrieving SQL data for system.job_info... writing output: debug/system.job_info.txt... done
[cluster] retrieving SQL data for system.jobs... writing output: debug/system.jobs.txt... done
[cluster] retrieving SQL data for system.lease... writing output: debug/system.lease.txt... done
[cluster] retrieving SQL data for system.locations... writing output: debug/system.locations.txt... done
Expand Down
3 changes: 3 additions & 0 deletions pkg/cli/testdata/zip/testzip_concurrent
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ zip
[cluster] retrieving SQL data for system.external_connections...
[cluster] retrieving SQL data for system.external_connections: done
[cluster] retrieving SQL data for system.external_connections: writing output: debug/system.external_connections.txt...
[cluster] retrieving SQL data for system.job_info...
[cluster] retrieving SQL data for system.job_info: done
[cluster] retrieving SQL data for system.job_info: writing output: debug/system.job_info.txt...
[cluster] retrieving SQL data for system.jobs...
[cluster] retrieving SQL data for system.jobs: done
[cluster] retrieving SQL data for system.jobs: writing output: debug/system.jobs.txt...
Expand Down
2 changes: 2 additions & 0 deletions pkg/cli/testdata/zip/testzip_shared_process_tenant
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ debug zip --concurrency=1 --cpu-profile-duration=1s /dev/null
[cluster] retrieving SQL data for system.descriptor... writing output: debug/system.descriptor.txt... done
[cluster] retrieving SQL data for system.eventlog... writing output: debug/system.eventlog.txt... done
[cluster] retrieving SQL data for system.external_connections... writing output: debug/system.external_connections.txt... done
[cluster] retrieving SQL data for system.job_info... writing output: debug/system.job_info.txt... done
[cluster] retrieving SQL data for system.jobs... writing output: debug/system.jobs.txt... done
[cluster] retrieving SQL data for system.lease... writing output: debug/system.lease.txt... done
[cluster] retrieving SQL data for system.locations... writing output: debug/system.locations.txt... done
Expand Down Expand Up @@ -231,6 +232,7 @@ debug zip --concurrency=1 --cpu-profile-duration=1s /dev/null
[cluster] retrieving SQL data for system.descriptor... writing output: debug/tenants/test-tenant/system.descriptor.txt... done
[cluster] retrieving SQL data for system.eventlog... writing output: debug/tenants/test-tenant/system.eventlog.txt... done
[cluster] retrieving SQL data for system.external_connections... writing output: debug/tenants/test-tenant/system.external_connections.txt... done
[cluster] retrieving SQL data for system.job_info... writing output: debug/tenants/test-tenant/system.job_info.txt... done
[cluster] retrieving SQL data for system.jobs... writing output: debug/tenants/test-tenant/system.jobs.txt... done
[cluster] retrieving SQL data for system.lease... writing output: debug/tenants/test-tenant/system.lease.txt... done
[cluster] retrieving SQL data for system.locations... writing output: debug/tenants/test-tenant/system.locations.txt... done
Expand Down
1 change: 1 addition & 0 deletions pkg/cli/testdata/zip/testzip_tenant_separate_process
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ debug zip --concurrency=1 --cpu-profile-duration=1s /dev/null
[cluster] retrieving SQL data for system.descriptor... writing output: debug/system.descriptor.txt... done
[cluster] retrieving SQL data for system.eventlog... writing output: debug/system.eventlog.txt... done
[cluster] retrieving SQL data for system.external_connections... writing output: debug/system.external_connections.txt... done
[cluster] retrieving SQL data for system.job_info... writing output: debug/system.job_info.txt... done
[cluster] retrieving SQL data for system.jobs... writing output: debug/system.jobs.txt... done
[cluster] retrieving SQL data for system.lease... writing output: debug/system.lease.txt... done
[cluster] retrieving SQL data for system.locations... writing output: debug/system.locations.txt... done
Expand Down
12 changes: 12 additions & 0 deletions pkg/cli/zip_table_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -994,6 +994,18 @@ var zipSystemTables = DebugZipTableRegistry{
to_hex(progress) AS hex_progress
FROM system.jobs`,
},
"system.job_info": {
// `value` column may contain customer info, such as URI params
// containing access keys, encryption salts, etc.
customQueryUnredacted: `SELECT *,
to_hex(value) AS hex_value
FROM system.job_info`,
customQueryRedacted: `SELECT job_id,
info_key,
written,
'redacted' AS value
FROM system.job_info`,
},
"system.lease": {
nonSensitiveCols: NonSensitiveColumns{
`"descID"`,
Expand Down

0 comments on commit 923cbc4

Please sign in to comment.