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

multitenant: \demo add is broken in multi-tenant mode #107888

Closed
ajstorm opened this issue Jul 31, 2023 · 0 comments · Fixed by #108566
Closed

multitenant: \demo add is broken in multi-tenant mode #107888

ajstorm opened this issue Jul 31, 2023 · 0 comments · Fixed by #108566
Assignees
Labels
A-demo A-multitenancy Related to multi-tenancy C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-multitenant Issues owned by the multi-tenant virtual team

Comments

@ajstorm
Copy link
Collaborator

ajstorm commented Jul 31, 2023

Describe the problem

The \demo add statement which adds nodes to a demo cluster is broken when demo runs in multi-tenant mode.

To Reproduce

  • cockroach demo --nodes 9
  • \demo add "region=us-central1"
  • \demo ls
Application tenant:
*
* ERROR: a panic has occurred!
* runtime error: index out of range [9] with length 9
* (1) attached stack trace
*   -- stack trace:
*   | runtime.gopanic
*   | 	GOROOT/src/runtime/panic.go:890
*   | runtime.goPanicIndex
*   | 	GOROOT/src/runtime/panic.go:113
*   | github.com/cockroachdb/cockroach/pkg/cli/democluster.(*transientCluster).ListDemoNodes
*   | 	github.com/cockroachdb/cockroach/pkg/cli/democluster/demo_cluster.go:1902
*   | github.com/cockroachdb/cockroach/pkg/cli/clisqlshell.(*cliState).handleDemo
*   | 	github.com/cockroachdb/cockroach/pkg/cli/clisqlshell/sql.go:696
*   | github.com/cockroachdb/cockroach/pkg/cli/clisqlshell.(*cliState).doHandleCliCmd
*   | 	github.com/cockroachdb/cockroach/pkg/cli/clisqlshell/sql.go:1579
*   | github.com/cockroachdb/cockroach/pkg/cli/clisqlshell.(*cliState).doRunShell
*   | 	github.com/cockroachdb/cockroach/pkg/cli/clisqlshell/sql.go:2326
*   | github.com/cockroachdb/cockroach/pkg/cli/clisqlshell.(*cliState).RunInteractive
*   | 	github.com/cockroachdb/cockroach/pkg/cli/clisqlshell/sql.go:2275
*   | github.com/cockroachdb/cockroach/pkg/cli/clisqlcfg.(*Context).Run
*   | 	github.com/cockroachdb/cockroach/pkg/cli/clisqlcfg/context.go:225
*   | github.com/cockroachdb/cockroach/pkg/cli.runDemoInternal
*   | 	github.com/cockroachdb/cockroach/pkg/cli/demo.go:383
*   | github.com/cockroachdb/cockroach/pkg/cli.runDemo
*   | 	github.com/cockroachdb/cockroach/pkg/cli/demo.go:200
*   | github.com/cockroachdb/cockroach/pkg/cli.init.5.func1
*   | 	github.com/cockroachdb/cockroach/pkg/cli/demo.go:59
*   | github.com/cockroachdb/cockroach/pkg/cli/clierrorplus.MaybeDecorateError.func1
*   | 	github.com/cockroachdb/cockroach/pkg/cli/clierrorplus/decorate_error.go:72
*   | github.com/spf13/cobra.(*Command).execute
*   | 	github.com/spf13/cobra/external/com_github_spf13_cobra/command.go:856
*   | github.com/spf13/cobra.(*Command).ExecuteC
*   | 	github.com/spf13/cobra/external/com_github_spf13_cobra/command.go:974
*   | github.com/spf13/cobra.(*Command).Execute
*   | 	github.com/spf13/cobra/external/com_github_spf13_cobra/command.go:902
*   | github.com/cockroachdb/cockroach/pkg/cli.Run
*   | 	github.com/cockroachdb/cockroach/pkg/cli/cli.go:300
*   | github.com/cockroachdb/cockroach/pkg/cli.doMain
*   | 	github.com/cockroachdb/cockroach/pkg/cli/cli.go:143
*   | github.com/cockroachdb/cockroach/pkg/cli.Main
*   | 	github.com/cockroachdb/cockroach/pkg/cli/cli.go:68
*   | main.main
*   | 	main/pkg/cmd/cockroach/main.go:26
*   | runtime.main
*   | 	GOROOT/src/runtime/proc.go:250
*   | runtime.goexit
*   | 	GOROOT/src/runtime/asm_arm64.s:1172
* Wraps: (2) runtime error: index out of range [9] with length 9
* Error types: (1) *withstack.withStack (2) runtime.boundsError
*
panic: runtime error: index out of range [9] with length 9 [recovered]
	panic: runtime error: index out of range [9] with length 9 [recovered]
	panic: runtime error: index out of range [9] with length 9

goroutine 1 [running]:
github.com/cockroachdb/cockroach/pkg/util/log/logcrash.RecoverAndReportPanic({0x109ab68c0, 0x140001a8010}, 0x140283e8c88?)
	github.com/cockroachdb/cockroach/pkg/util/log/logcrash/crash_reporting.go:132 +0x74
panic({0x1096a9820, 0x1403f187248})
	GOROOT/src/runtime/panic.go:884 +0x204
github.com/cockroachdb/cockroach/pkg/cli/democluster.(*transientCluster).Close(0x14002f20000, {0x109ab68c0?, 0x140001a8010})
	github.com/cockroachdb/cockroach/pkg/cli/democluster/demo_cluster.go:968 +0x1cc
panic({0x1096a9820, 0x1403f187248})
	GOROOT/src/runtime/panic.go:890 +0x258
github.com/cockroachdb/cockroach/pkg/cli/democluster.(*transientCluster).ListDemoNodes(0x14002f20000, {0x109a70aa0, 0x140001c0008}, {0x109a70aa0, 0x140005aa060}, 0x0, 0x1)
	github.com/cockroachdb/cockroach/pkg/cli/democluster/demo_cluster.go:1902 +0x9d8
github.com/cockroachdb/cockroach/pkg/cli/clisqlshell.(*cliState).handleDemo(0x1401befe940?, {0x14024234050?, 0x10748a028?, 0x1?}, 0x140627271f8?, 0x0?)
	github.com/cockroachdb/cockroach/pkg/cli/clisqlshell/sql.go:696 +0x84
github.com/cockroachdb/cockroach/pkg/cli/clisqlshell.(*cliState).doHandleCliCmd(0x1401cbd1b80, 0x2, 0x14028f29308?)
	github.com/cockroachdb/cockroach/pkg/cli/clisqlshell/sql.go:1579 +0xa50
github.com/cockroachdb/cockroach/pkg/cli/clisqlshell.(*cliState).doRunShell(0x1401cbd1b80, 0x119ac5cb8?, 0x10f8bcf18?, 0xd0?, 0x140005aa060)
	github.com/cockroachdb/cockroach/pkg/cli/clisqlshell/sql.go:2326 +0x2fc
github.com/cockroachdb/cockroach/pkg/cli/clisqlshell.(*cliState).RunInteractive(0x14000e431d0?, 0x109b25260?, 0x14011ecf520?, 0x140130b0870?)
	github.com/cockroachdb/cockroach/pkg/cli/clisqlshell/sql.go:2275 +0x5c
github.com/cockroachdb/cockroach/pkg/cli/clisqlcfg.(*Context).Run(0x14000e431d0, {0x109ab68c0, 0x140001a8010}, {0x109b25260?, 0x14011ecf520})
	github.com/cockroachdb/cockroach/pkg/cli/clisqlcfg/context.go:225 +0x2ec
github.com/cockroachdb/cockroach/pkg/cli.runDemoInternal(0x10dab3020, {0x0, 0x0}, 0x109a08a80)
	github.com/cockroachdb/cockroach/pkg/cli/demo.go:383 +0xc40
github.com/cockroachdb/cockroach/pkg/cli.runDemo(...)
	github.com/cockroachdb/cockroach/pkg/cli/demo.go:200
github.com/cockroachdb/cockroach/pkg/cli.init.5.func1(0x9?, {0x1400099da38?, 0x1?, 0xc?})
	github.com/cockroachdb/cockroach/pkg/cli/demo.go:59 +0x2c
github.com/cockroachdb/cockroach/pkg/cli/clierrorplus.MaybeDecorateError.func1(0x10dab3020?, {0x1400129e1e0?, 0x2?, 0x2?})
	github.com/cockroachdb/cockroach/pkg/cli/clierrorplus/decorate_error.go:72 +0x34
github.com/spf13/cobra.(*Command).execute(0x10dab3020, {0x1400129e1c0, 0x2, 0x2})
	github.com/spf13/cobra/external/com_github_spf13_cobra/command.go:856 +0x4dc
github.com/spf13/cobra.(*Command).ExecuteC(0x10daab0a0)
	github.com/spf13/cobra/external/com_github_spf13_cobra/command.go:974 +0x360
github.com/spf13/cobra.(*Command).Execute(...)
	github.com/spf13/cobra/external/com_github_spf13_cobra/command.go:902
github.com/cockroachdb/cockroach/pkg/cli.Run(...)
	github.com/cockroachdb/cockroach/pkg/cli/cli.go:300
github.com/cockroachdb/cockroach/pkg/cli.doMain(0x10dab3020, {0x1400340401a, 0x4})
	github.com/cockroachdb/cockroach/pkg/cli/cli.go:143 +0x1cc
github.com/cockroachdb/cockroach/pkg/cli.Main()
	github.com/cockroachdb/cockroach/pkg/cli/cli.go:68 +0x194
main.main()
	main/pkg/cmd/cockroach/main.go:26 +0x1c

Expected behavior
No panic. Lists all nodes (including the newly added 10th node)

Jira issue: CRDB-30244
Epic: CRDB-26691

@ajstorm ajstorm added C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. A-demo A-multitenancy Related to multi-tenancy T-multitenant Issues owned by the multi-tenant virtual team labels Jul 31, 2023
@knz knz self-assigned this Aug 10, 2023
@craig craig bot closed this as completed in 9ac5f22 Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-demo A-multitenancy Related to multi-tenancy C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-multitenant Issues owned by the multi-tenant virtual team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants