pkg/clusterversion/runbooks/M5_finalize_gates_and_bootstrap_data.md
When to perform: After the final .0 release is published (e.g., v26.1.0).
What it does: Updates the bootstrap data that was generated during M.2 to reflect the final released version. The M.2 bootstrap data was generated from the release branch before the final release was cut; M.5 refreshes it from the exact release tag.
Dependencies:
.0 release tag must exist (e.g., v26.1.0)# Verify the final release tag exists
git ls-remote origin 'refs/tags/v26.1.0'
# Confirm bootstrap data from M.2 is already on master
ls pkg/sql/catalog/bootstrap/data/26_1_*
git checkout master && git pull
git checkout -b m5-bootstrap-26.1
Using a worktree avoids switching branches in your main working tree.
git fetch origin release-26.1
git worktree add /tmp/release-26.1-worktree origin/release-26.1
cd /tmp/release-26.1-worktree
git checkout v26.1.0
Important: Use the .0 release tag, not the current HEAD of the release
branch. The HEAD may have backports applied after the release was cut.
cd /tmp/release-26.1-worktree
./dev doctor # only needed if first time using this worktree
./dev build sql-bootstrap-data && bin/sql-bootstrap-data
The tool generates 4 files in pkg/sql/catalog/bootstrap/data/:
26_1_system.keys26_1_system.sha25626_1_tenant.keys26_1_tenant.sha256cp /tmp/release-26.1-worktree/pkg/sql/catalog/bootstrap/data/26_1_* \
~/go/src/github.com/cockroachdb/cockroach/pkg/sql/catalog/bootstrap/data/
cd ~/go/src/github.com/cockroachdb/cockroach/pkg/sql/catalog/bootstrap/data
sha256sum 26_1_system.keys | awk '{print $1}' | tr -d '\n' > /tmp/actual.sha256
diff /tmp/actual.sha256 26_1_system.sha256 && echo "system hash OK"
sha256sum 26_1_tenant.keys | awk '{print $1}' | tr -d '\n' > /tmp/actual.sha256
diff /tmp/actual.sha256 26_1_tenant.sha256 && echo "tenant hash OK"
If the hashes didn't change, the bootstrap data was already up to date and no commit is needed.
Verify all V26_1_* gates have the same version values on both branches:
# Extract gates from master
grep "V26_1" pkg/clusterversion/cockroach_versions.go \
| grep -v "PreviousRelease\|finalVersion\|V26_2" > /tmp/master_gates.txt
# Extract gates from release
grep "V26_1" /tmp/release-26.1-worktree/pkg/clusterversion/cockroach_versions.go \
| grep -v "PreviousRelease\|finalVersion" > /tmp/release_gates.txt
diff /tmp/master_gates.txt /tmp/release_gates.txt && echo "Gates match"
If there are differences, investigate whether any V26_1 gates were added to the release branch but not backported to master (or vice versa). File issues as needed.
cd ~/go/src/github.com/cockroachdb/cockroach
./dev test pkg/sql/catalog/bootstrap -v
All tests should pass.
git worktree remove --force /tmp/release-26.1-worktree
Only bootstrap data files change — no Go code changes are needed:
pkg/sql/catalog/bootstrap/data/26_1_system.keyspkg/sql/catalog/bootstrap/data/26_1_system.sha256pkg/sql/catalog/bootstrap/data/26_1_tenant.keyspkg/sql/catalog/bootstrap/data/26_1_tenant.sha256If the hashes are unchanged from M.2, the release was cut without further schema changes and there is nothing to commit.
v26.1.0) exists on origin.0 tag (not branch HEAD)"working trees containing submodules cannot be moved or removed"
Use --force when removing the worktree:
git worktree remove --force /tmp/release-26.1-worktree
Hashes are the same as M.2
If the .sha256 files don't change, the schema was frozen before the final
release and M.5 is a no-op. No PR needed.
Gate diff shows differences
A gate present on the release branch but missing from master means it was added as a backport after M.2/M.3 were merged. File a bug and add the gate to master manually (following the same versioning as on the release branch).
# Create worktree at the .0 tag
git fetch origin release-26.1
git worktree add /tmp/release-26.1-worktree origin/release-26.1
cd /tmp/release-26.1-worktree && git checkout v26.1.0
# Generate bootstrap data
./dev build sql-bootstrap-data && bin/sql-bootstrap-data
# Copy to master
cp /tmp/release-26.1-worktree/pkg/sql/catalog/bootstrap/data/26_1_* \
~/go/src/github.com/cockroachdb/cockroach/pkg/sql/catalog/bootstrap/data/
# Verify hashes
cd ~/go/src/github.com/cockroachdb/cockroach/pkg/sql/catalog/bootstrap/data
sha256sum 26_1_system.keys | awk '{print $1}' | tr -d '\n' > /tmp/a && diff /tmp/a 26_1_system.sha256 && echo OK
sha256sum 26_1_tenant.keys | awk '{print $1}' | tr -d '\n' > /tmp/a && diff /tmp/a 26_1_tenant.sha256 && echo OK
# Run tests
cd ~/go/src/github.com/cockroachdb/cockroach && ./dev test pkg/sql/catalog/bootstrap -v
# Clean up
git worktree remove --force /tmp/release-26.1-worktree
Example PR: #165680