Skip to content

Commit

Permalink
Merge #50621
Browse files Browse the repository at this point in the history
50621: cli: don't pull liveness twice r=knz a=tbg

Fixes #49520

Noticed this since on OSX `unzip` asks me whether to overwrite `liveness.json`
This seems harmless other than that though.

Release note: None


Co-authored-by: Tobias Schottdorf <[email protected]>
  • Loading branch information
craig[bot] and tbg committed Aug 4, 2020
2 parents 71e1113 + f27e880 commit 1087151
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 11 deletions.
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

0 comments on commit 1087151

Please sign in to comment.