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: fix roachprod init. #88514

Merged
merged 1 commit into from
Sep 23, 2022

Conversation

renatolabs
Copy link
Contributor

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

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
@renatolabs renatolabs requested a review from a team as a code owner September 22, 2022 21:36
@renatolabs renatolabs requested review from srosenberg and removed request for a team September 22, 2022 21:36
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@erikgrinaker erikgrinaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick fix!

@renatolabs
Copy link
Contributor Author

bors r=srosenberg,erikgrinaker

TFTR!

@craig
Copy link
Contributor

craig bot commented Sep 23, 2022

Build succeeded:

@craig craig bot merged commit 4f3bb99 into cockroachdb:master Sep 23, 2022
@yuzefovich
Copy link
Member

I think this change might have had an unintended side effect - we no longer set the test license, which causes failures like #88665.

renatolabs added a commit to renatolabs/cockroach that referenced this pull request Sep 26, 2022
In cockroachdb#88514, the cluster start logic was refactored to reuse the same
code across `init` and `start`, fixing a bug in the former. However,
the refactoring overlooked the fact that we previously always set the
default cluster settings when there's more than one node in the
cluster.

This fixes that by setting the default cluster settings in that case;
one particularly important cluster setting is the license key,
necessary for some roachtests.

Fixes cockroachdb#88660, cockroachdb#88665, cockroachdb#88666.

Release note: None
renatolabs added a commit to renatolabs/cockroach that referenced this pull request Sep 26, 2022
In cockroachdb#88514, the cluster start logic was refactored to reuse the same
code across `init` and `start`, fixing a bug in the former. However,
the refactoring overlooked the fact that we previously always set the
default cluster settings when there's more than one node in the
cluster.

This fixes that by setting the default cluster settings in that case;
one particularly important cluster setting is the license key,
necessary for some roachtests.

Fixes cockroachdb#88660.
Fixes cockroachdb#88665.
Fixes cockroachdb#88666.
Fixes cockroachdb#88710.

Release note: None
craig bot pushed a commit that referenced this pull request Sep 26, 2022
88252: storage: add gc benchmarks with multiple range tombstones r=erikgrinaker a=aliher1911

Previously we only had tests that verify GC performance with no range tombstones or with a single range tombstone under all the data. This commit extends the benchmark to have many tombstones interleaving data at different keys.

Release note: None

Fixes #87417

88295: sql: add assertion for txn passed to internal executor r=ajwerner a=ZhouXing19

If an internal executor is created with a txn binding to it, it should not be used to execute a statement with a nil txn.

Release note: None

88670: schemachanger/rel: fix race due to failure to clone constraint slots r=ajwerner a=ajwerner

The fundamental race here is that while the slots themselves were being copied by value, the "any" clauses which are a slice were not. The second bug here is that the "inline" values were not being properly reset. That bug could lead to problems when the query was run again in the context of a different element set. We need to reset those inline values too.

Fixes #88628

Release note: None

88716: roachprod: set default cluster settings when starting r=yuzefovich,srosenberg,smg260 a=renatolabs

In #88514, the cluster start logic was refactored to reuse the same code across `init` and `start`, fixing a bug in the former. However, the refactoring overlooked the fact that we previously always set the default cluster settings when there's more than one node in the cluster.

This fixes that by setting the default cluster settings in that case; one particularly important cluster setting is the license key, necessary for some roachtests.

Fixes #88660
Fixes #88665
Fixes #88666
Fixes #88710.

Release note: None

Co-authored-by: Oleg Afanasyev <oleg@cockroachlabs.com>
Co-authored-by: Jane Xing <zhouxing@uchicago.edu>
Co-authored-by: Andrew Werner <awerner32@gmail.com>
Co-authored-by: Renato Costa <renato@cockroachlabs.com>
smg260 pushed a commit to smg260/cockroach that referenced this pull request Jan 18, 2023
In cockroachdb#88514, the cluster start logic was refactored to reuse the same
code across `init` and `start`, fixing a bug in the former. However,
the refactoring overlooked the fact that we previously always set the
default cluster settings when there's more than one node in the
cluster.

This fixes that by setting the default cluster settings in that case;
one particularly important cluster setting is the license key,
necessary for some roachtests.

Fixes cockroachdb#88660.
Fixes cockroachdb#88665.
Fixes cockroachdb#88666.
Fixes cockroachdb#88710.

Release note: None
smg260 pushed a commit to smg260/cockroach that referenced this pull request Jan 18, 2023
In cockroachdb#88514, the cluster start logic was refactored to reuse the same
code across `init` and `start`, fixing a bug in the former. However,
the refactoring overlooked the fact that we previously always set the
default cluster settings when there's more than one node in the
cluster.

This fixes that by setting the default cluster settings in that case;
one particularly important cluster setting is the license key,
necessary for some roachtests.

Fixes cockroachdb#88660.
Fixes cockroachdb#88665.
Fixes cockroachdb#88666.
Fixes cockroachdb#88710.

Release note: None
smg260 pushed a commit to smg260/cockroach that referenced this pull request Mar 7, 2023
In cockroachdb#88514, the cluster start logic was refactored to reuse the same
code across `init` and `start`, fixing a bug in the former. However,
the refactoring overlooked the fact that we previously always set the
default cluster settings when there's more than one node in the
cluster.

This fixes that by setting the default cluster settings in that case;
one particularly important cluster setting is the license key,
necessary for some roachtests.

Fixes cockroachdb#88660.
Fixes cockroachdb#88665.
Fixes cockroachdb#88666.
Fixes cockroachdb#88710.

Release note: None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

roachprod: init does not work with local cluster on Linux
5 participants