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

roachprod: init does not work with local cluster on Linux #88226

Closed
erikgrinaker opened this issue Sep 20, 2022 · 1 comment · Fixed by #88514
Closed

roachprod: init does not work with local cluster on Linux #88226

erikgrinaker opened this issue Sep 20, 2022 · 1 comment · Fixed by #88514
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-testeng TestEng Team

Comments

@erikgrinaker
Copy link
Contributor

erikgrinaker commented Sep 20, 2022

On a gceworker:

$ roachprod create local -n 3
$ roachprod start local --skip-init
$ roachprod init local

12:47:35 cluster_synced.go:2300: local: initializing cluster
panic: invalid nodeIdx

goroutine 1 [running]:
github.com/cockroachdb/cockroach/pkg/roachprod/vm/local.VMDir({0xc0002c7030?, 0xc00081f7b0?}, 0x4e0085?)
	github.com/cockroachdb/cockroach/pkg/roachprod/vm/local/local.go:46 +0x292
github.com/cockroachdb/cockroach/pkg/roachprod/install.(*SyncedCluster).localVMDir(...)
	github.com/cockroachdb/cockroach/pkg/roachprod/install/cluster_synced.go:123
github.com/cockroachdb/cockroach/pkg/roachprod/install.(*SyncedCluster).NodeDir(0xc00065cb40, 0x8?, 0x1)
	github.com/cockroachdb/cockroach/pkg/roachprod/install/cockroach.go:219 +0x6c
github.com/cockroachdb/cockroach/pkg/roachprod/install.(*SyncedCluster).generateInitCmd(0xc00065cb40, 0x0)
	github.com/cockroachdb/cockroach/pkg/roachprod/install/cockroach.go:679 +0xc9
github.com/cockroachdb/cockroach/pkg/roachprod/install.(*SyncedCluster).initializeCluster(0xc0000b2d80?, {0x12289f0, 0xc00003a0a0}, 0x2?)
	github.com/cockroachdb/cockroach/pkg/roachprod/install/cockroach.go:612 +0x71
github.com/cockroachdb/cockroach/pkg/roachprod/install.(*SyncedCluster).Init(0xc00065cb40, {0x12289f0, 0xc00003a0a0}, 0x0?)
	github.com/cockroachdb/cockroach/pkg/roachprod/install/cluster_synced.go:2301 +0xc6
github.com/cockroachdb/cockroach/pkg/roachprod.Init({0x12289f0, 0xc00003a0a0}, 0xc0006bfb18?, {0x7ffe018f5a90, 0x5})
	github.com/cockroachdb/cockroach/pkg/roachprod/roachprod.go:719 +0x7f
main.glob..func12(0x2?, {0xc0003c73b0?, 0xc0006bfb30?, 0x5a37e5?})
	main/pkg/cmd/roachprod/main.go:488 +0x45
main.wrap.func1(0x18a85e0?, {0xc0003c73b0?, 0x1?, 0x1?})
	main/pkg/cmd/roachprod/main.go:68 +0x3c
github.com/spf13/cobra.(*Command).execute(0x18a85e0, {0xc0003c7390, 0x1, 0x1})
	github.com/spf13/cobra/external/com_github_spf13_cobra/command.go:860 +0x663
github.com/spf13/cobra.(*Command).ExecuteC(0x18a7be0)
	github.com/spf13/cobra/external/com_github_spf13_cobra/command.go:974 +0x3b4
github.com/spf13/cobra.(*Command).Execute(...)
	github.com/spf13/cobra/external/com_github_spf13_cobra/command.go:902
main.main()
	main/pkg/cmd/roachprod/main.go:1044 +0x785

Jira issue: CRDB-19735

@erikgrinaker erikgrinaker added C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-testeng TestEng Team labels Sep 20, 2022
@blathers-crl
Copy link

blathers-crl bot commented Sep 20, 2022

cc @cockroachdb/test-eng

craig bot pushed a commit that referenced this issue Sep 23, 2022
88514: roachprod: fix `roachprod init`. r=srosenberg,erikgrinaker a=renatolabs

When a cluster is started with the `--skip-init` option, the caller can run `roachprod init` at any time to initialize the cluster. Unfortunately, the code used to initialize the cluster was duplicated: one copy existed in the `start` path, and another in the `init` path. Since the latter is used far less frequently, it had a bug that went unnoticed: it hardcoded the first node index as `0`, when node indices start at 1.

This commit fixes the issue by updating the constant and sharing code between `init `and `start`.

Fixes #88226.

Release note: None

Co-authored-by: Renato Costa <[email protected]>
@craig craig bot closed this as completed in 72fc0af Sep 23, 2022
smg260 pushed a commit to smg260/cockroach that referenced this issue Jan 18, 2023
When a cluster is started with the `--skip-init` option, the caller
can run `roachprod init` at any time to initialize the
cluster. Unfortunately, the code used to initialize the cluster was
duplicated: one copy existed in the `start` path, and another in the
`init` path. Since the latter is used far less frequently, it had a
bug that went unnoticed: it hardcoded the first node index as `0`,
when node indices start at 1.

This commit fixes the issue by updating the constant and sharing code
between `init `and `start`.

Fixes cockroachdb#88226.

Release note: None
smg260 pushed a commit to smg260/cockroach that referenced this issue Jan 18, 2023
When a cluster is started with the `--skip-init` option, the caller
can run `roachprod init` at any time to initialize the
cluster. Unfortunately, the code used to initialize the cluster was
duplicated: one copy existed in the `start` path, and another in the
`init` path. Since the latter is used far less frequently, it had a
bug that went unnoticed: it hardcoded the first node index as `0`,
when node indices start at 1.

This commit fixes the issue by updating the constant and sharing code
between `init `and `start`.

Fixes cockroachdb#88226.

Release note: None
smg260 pushed a commit to smg260/cockroach that referenced this issue Mar 7, 2023
When a cluster is started with the `--skip-init` option, the caller
can run `roachprod init` at any time to initialize the
cluster. Unfortunately, the code used to initialize the cluster was
duplicated: one copy existed in the `start` path, and another in the
`init` path. Since the latter is used far less frequently, it had a
bug that went unnoticed: it hardcoded the first node index as `0`,
when node indices start at 1.

This commit fixes the issue by updating the constant and sharing code
between `init `and `start`.

Fixes cockroachdb#88226.

Release note: None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-testeng TestEng Team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant