Skip to content

upgrade/upgrades: add env var to skip nonessential bootstrap steps#168623

Open
gmcquillan wants to merge 1 commit intocockroachdb:masterfrom
gmcquillan:gm-skip-nonessential-bootstrap
Open

upgrade/upgrades: add env var to skip nonessential bootstrap steps#168623
gmcquillan wants to merge 1 commit intocockroachdb:masterfrom
gmcquillan:gm-skip-nonessential-bootstrap

Conversation

@gmcquillan
Copy link
Copy Markdown

Adds COCKROACH_SKIP_NONESSENTIAL_BOOTSTRAP, a boolean env var read at
package init. When set, bootstrapSystem and bootstrapCluster skip
the substeps marked skippableInTest, mirroring the existing
SkipSomeUpgradeSteps testing knob used by in-process test servers.

The existing knob is reachable only via Go-level TestingKnobs, which
containerized test harnesses (testcontainers, docker-compose) cannot
set. Exposing the same fast path through an env var lets those setups
skip the observability scaffolding (scheduled jobs, cluster.secret
initialization, diagnostics opt-in, default system.locations entries,
key visualizer tables) that isn't needed for short-lived tests, while
still executing the essential steps: cluster version, root user and
admin role, and default databases.

Intended for dev/test clusters only; the env var is not gated by build
tags and will take effect in production binaries if set, consistent
with the convention established by other COCKROACH_SKIP_* env vars.

Epic: none

Release note (ops change): Added a new environment variable,
COCKROACH_SKIP_NONESSENTIAL_BOOTSTRAP, which when set causes a new
cluster to skip the nonessential steps of its first-time bootstrap
(scheduled observability jobs, cluster.secret initialization,
diagnostics opt-in, default system.locations data, and the key
visualizer tables). Intended only for dev/test clusters where bootstrap
latency matters; do not enable in production.

Adds COCKROACH_SKIP_NONESSENTIAL_BOOTSTRAP, a boolean env var read at
package init. When set, bootstrapSystem and bootstrapCluster skip the
substeps marked skippableInTest, mirroring the existing
SkipSomeUpgradeSteps testing knob used by in-process test servers.

The existing knob is reachable only via Go-level TestingKnobs, which
containerized test harnesses (testcontainers, docker-compose) cannot
set. Exposing the same fast path through an env var lets those setups
skip the observability scaffolding (scheduled jobs, cluster.secret
initialization, diagnostics opt-in, default system.locations entries,
key visualizer tables) that isn't needed for short-lived tests, while
still executing the essential steps: cluster version, root user and
admin role, and default databases.

Intended for dev/test clusters only; the env var is not gated by build
tags and will take effect in production binaries if set, consistent
with the convention established by other COCKROACH_SKIP_* env vars.

Epic: none

Release note (ops change): Added a new environment variable,
COCKROACH_SKIP_NONESSENTIAL_BOOTSTRAP, which when set causes a new
cluster to skip the nonessential steps of its first-time bootstrap
(scheduled observability jobs, cluster.secret initialization,
diagnostics opt-in, default system.locations data, and the key
visualizer tables). Intended only for dev/test clusters where bootstrap
latency matters; do not enable in production.
@gmcquillan gmcquillan requested review from a team as code owners April 17, 2026 23:20
@trunk-io
Copy link
Copy Markdown
Contributor

trunk-io Bot commented Apr 17, 2026

Merging to master in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@blathers-crl
Copy link
Copy Markdown

blathers-crl Bot commented Apr 17, 2026

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

Thank you for contributing to CockroachDB. Please ensure you have followed the guidelines for creating a PR.

My owl senses detect your PR is good for review. Please keep an eye out for any test failures in CI.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@blathers-crl blathers-crl Bot added the O-community Originated from the community label Apr 17, 2026
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@cockroachlabs-cla-agent
Copy link
Copy Markdown

cockroachlabs-cla-agent Bot commented Apr 17, 2026

CLA assistant check
All committers have signed the CLA.

@gmcquillan
Copy link
Copy Markdown
Author

We see bootstrapCluster taking about 44ms without this flag, and 25ms with the flag enabled. This shaves an average of 19ms from cluster bootstrapping in testing, which can add up if multiple containers are used or invoked in an integration setting.

@bghal bghal added the T-release Release Engineering & Automation Team label Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-community Originated from the community T-release Release Engineering & Automation Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants