Skip to content

Commit

Permalink
Merge #106117
Browse files Browse the repository at this point in the history
106117: cli/zip: emphasize "cluster virtualization" r=yuzefovich a=knz

Informs #106068.
Epic: [CRDB-29380](https://cockroachlabs.atlassian.net/browse/CRDB-29380)

Release note (cli change): When `debug zip` is pointed at a multi-tenant cluster or a cluster with virtualization enabled, data about virtual clusters is now stored in a `virtual` sub-directory (this was previously named `tenants`).

Co-authored-by: Raphael 'kena' Poss <[email protected]>
  • Loading branch information
craig[bot] and knz committed Jul 6, 2023
2 parents 6578cef + cc1ffa7 commit 5e87ff5
Show file tree
Hide file tree
Showing 11 changed files with 140 additions and 140 deletions.
2 changes: 1 addition & 1 deletion pkg/cli/testdata/zip/partial1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
zip
----
debug zip --concurrency=1 --cpu-profile-duration=0s /dev/null
[cluster] discovering tenants on cluster... done
[cluster] discovering virtual clusters... done
[cluster] creating output file /dev/null... done
[cluster] establishing RPC connection to ...
[cluster] using SQL address: ...
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/testdata/zip/partial1_excluded
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
zip
----
debug zip /dev/null --concurrency=1 --exclude-nodes=2 --cpu-profile-duration=0
[cluster] discovering tenants on cluster... done
[cluster] discovering virtual clusters... done
[cluster] creating output file /dev/null... done
[cluster] establishing RPC connection to ...
[cluster] using SQL address: ...
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/testdata/zip/partial2
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
zip
----
debug zip --concurrency=1 --cpu-profile-duration=0 /dev/null
[cluster] discovering tenants on cluster... done
[cluster] discovering virtual clusters... done
[cluster] creating output file /dev/null... done
[cluster] establishing RPC connection to ...
[cluster] using SQL address: ...
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/testdata/zip/testzip
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
zip
----
debug zip --concurrency=1 --cpu-profile-duration=1s /dev/null
[cluster] discovering tenants on cluster... done
[cluster] discovering virtual clusters... done
[cluster] creating output file /dev/null... done
[cluster] establishing RPC connection to ...
[cluster] using SQL address: ...
Expand Down
4 changes: 2 additions & 2 deletions pkg/cli/testdata/zip/testzip_concurrent
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ zip
----
[cluster] creating output file /dev/null...
[cluster] creating output file /dev/null: done
[cluster] discovering tenants on cluster...
[cluster] discovering tenants on cluster: done
[cluster] discovering virtual clusters...
[cluster] discovering virtual clusters: done
[cluster] establishing RPC connection to ...
[cluster] establishing RPC connection to ...
[cluster] hot range summary script...
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
zip
----
debug zip --concurrency=1 --cpu-profile-duration=1s /dev/null
[cluster] discovering tenants on cluster... done
[cluster] discovering virtual clusters... done
[cluster] creating output file /dev/null... done
[cluster] establishing RPC connection to ...
[cluster] using SQL address: ...
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/testdata/zip/testzip_include_range_info
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
zip
----
debug zip --concurrency=1 --cpu-profile-duration=1s --include-range-info /dev/null
[cluster] discovering tenants on cluster... done
[cluster] discovering virtual clusters... done
[cluster] creating output file /dev/null... done
[cluster] establishing RPC connection to ...
[cluster] using SQL address: ...
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/cli/testdata/zip/unavailable
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
zip
----
debug zip --concurrency=1 --cpu-profile-duration=0 /dev/null --timeout=.5s
[cluster] discovering tenants on cluster... done
[cluster] discovering virtual clusters... done
[cluster] creating output file /dev/null... done
[cluster] establishing RPC connection to ...
[cluster] using SQL address: ...
Expand Down
6 changes: 3 additions & 3 deletions pkg/cli/zip.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,15 @@ func runDebugZip(cmd *cobra.Command, args []string) (retErr error) {

var tenants []*serverpb.Tenant
if err := func() error {
s := zr.start("discovering tenants on cluster")
s := zr.start("discovering virtual clusters")
conn, _, finish, err := getClientGRPCConn(ctx, serverCfg)
if err != nil {
return s.fail(err)
}
defer finish()

var resp *serverpb.ListTenantsResponse
if err := timeutil.RunWithTimeout(context.Background(), "list tenants", timeout, func(ctx context.Context) error {
if err := timeutil.RunWithTimeout(context.Background(), "list virtual clusters", timeout, func(ctx context.Context) error {
resp, err = serverpb.NewAdminClient(conn).ListTenants(ctx, &serverpb.ListTenantsRequest{})
return err
}); err != nil {
Expand Down Expand Up @@ -267,7 +267,7 @@ func runDebugZip(cmd *cobra.Command, args []string) (retErr error) {
// Only add tenant prefix for non system tenants.
var prefix string
if tenant.TenantId.ToUint64() != roachpb.SystemTenantID.ToUint64() {
prefix = fmt.Sprintf("/tenants/%s", tenant.TenantName)
prefix = fmt.Sprintf("/virtual/%s", tenant.TenantName)
}

zc := debugZipContext{
Expand Down
4 changes: 2 additions & 2 deletions pkg/cli/zip_tenant_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestTenantZip(t *testing.T) {
addTenantArgs func(params TestCLIParams) TestCLIParams
}{
{
testName: "testzip tenant separate process",
testName: "testzip external process virtualization",
addTenantArgs: func(params TestCLIParams) TestCLIParams {
tenantDir, tenantDirCleanupFn := testutils.TempDir(t)
defer tenantDirCleanupFn()
Expand All @@ -47,7 +47,7 @@ func TestTenantZip(t *testing.T) {
},
},
{
testName: "testzip shared process tenant",
testName: "testzip shared process virtualization",
addTenantArgs: func(params TestCLIParams) TestCLIParams {
params.SharedProcessTenantArgs = &base.TestSharedProcessTenantArgs{
TenantName: "test-tenant",
Expand Down

0 comments on commit 5e87ff5

Please sign in to comment.