Skip to content
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: don't pull liveness twice #50621

Merged
merged 1 commit into from
Aug 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion pkg/cli/testdata/zip/partial1_excluded
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ using SQL connection URL: postgresql://...
writing /dev/null
requesting data for debug/events... writing: debug/events.json
requesting data for debug/rangelog... writing: debug/rangelog.json
requesting data for debug/liveness... writing: debug/liveness.json
requesting data for debug/settings... writing: debug/settings.json
requesting data for debug/reports/problemranges... writing: debug/reports/problemranges.json
retrieving SQL data for crdb_internal.cluster_queries... writing: debug/crdb_internal.cluster_queries.txt
Expand Down
1 change: 0 additions & 1 deletion pkg/cli/testdata/zip/partial2
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ using SQL connection URL: postgresql://...
writing /dev/null
requesting data for debug/events... writing: debug/events.json
requesting data for debug/rangelog... writing: debug/rangelog.json
requesting data for debug/liveness... writing: debug/liveness.json
requesting data for debug/settings... writing: debug/settings.json
requesting data for debug/reports/problemranges... writing: debug/reports/problemranges.json
retrieving SQL data for crdb_internal.cluster_queries... writing: debug/crdb_internal.cluster_queries.txt
Expand Down
1 change: 0 additions & 1 deletion pkg/cli/testdata/zip/testzip
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ using SQL connection URL: postgresql://...
writing /dev/null
requesting data for debug/events... writing: debug/events.json
requesting data for debug/rangelog... writing: debug/rangelog.json
requesting data for debug/liveness... writing: debug/liveness.json
requesting data for debug/settings... writing: debug/settings.json
requesting data for debug/reports/problemranges... writing: debug/reports/problemranges.json
retrieving SQL data for crdb_internal.cluster_queries... writing: debug/crdb_internal.cluster_queries.txt
Expand Down
1 change: 0 additions & 1 deletion pkg/cli/testdata/zip/unavailable
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ requesting data for debug/events... writing: debug/events.json.err.txt
^- resulted in ...
requesting data for debug/rangelog... writing: debug/rangelog.json.err.txt
^- resulted in ...
requesting data for debug/liveness... writing: debug/liveness.json
requesting data for debug/settings... writing: debug/settings.json
requesting data for debug/reports/problemranges... writing: debug/reports/problemranges.json
retrieving SQL data for crdb_internal.cluster_queries... writing: debug/crdb_internal.cluster_queries.txt
Expand Down
10 changes: 3 additions & 7 deletions pkg/cli/zip.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,8 @@ func runDebugZip(cmd *cobra.Command, args []string) (retErr error) {
return z.createJSONOrError(r.pathName+".json", data, err)
}

// NB: we intentionally omit liveness since it's already pulled manually (we
// act on the output to special case decommissioned nodes).
for _, r := range []zipRequest{
{
fn: func(ctx context.Context) (interface{}, error) {
Expand All @@ -307,12 +309,6 @@ func runDebugZip(cmd *cobra.Command, args []string) (retErr error) {
},
pathName: rangelogName,
},
{
fn: func(ctx context.Context) (interface{}, error) {
return admin.Liveness(ctx, &serverpb.LivenessRequest{})
},
pathName: livenessName,
},
{
fn: func(ctx context.Context) (interface{}, error) {
return admin.Settings(ctx, &serverpb.SettingsRequest{})
Expand Down Expand Up @@ -371,7 +367,7 @@ func runDebugZip(cmd *cobra.Command, args []string) (retErr error) {
lresponse, err = admin.Liveness(ctx, &serverpb.LivenessRequest{})
return err
})
if cErr := z.createJSONOrError(base+"/liveness.json", nodes, err); cErr != nil {
if cErr := z.createJSONOrError(livenessName+".json", nodes, err); cErr != nil {
return cErr
}
livenessByNodeID := map[roachpb.NodeID]kvserverpb.NodeLivenessStatus{}
Expand Down