Skip to content

clusterversion: don't assume BinaryMinSupportedVersionKey is first#96702

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
RaduBerinde:dev-offset-min-ver
Feb 7, 2023
Merged

clusterversion: don't assume BinaryMinSupportedVersionKey is first#96702
craig[bot] merged 1 commit intocockroachdb:masterfrom
RaduBerinde:dev-offset-min-ver

Conversation

@RaduBerinde
Copy link
Copy Markdown
Member

The code that applies a "dev offset" to versions assumes that the minimum supported version key is the first (non-primordial) key. This forces us to remove keys when bumping BinaryMinSupportedVersionKey.

This change improves this code to specifically check for BinaryMinSupportedVersionKey so that we can clean up old keys after bumping the min supported version.

Release note: None
Epic: none

The code that applies a "dev offset" to versions assumes that the
minimum supported version key is the first (non-primordial) key. This
forces us to remove keys when bumping `BinaryMinSupportedVersionKey`.

This change improves this code to specifically check for
`BinaryMinSupportedVersionKey` so that we can clean up old keys after
bumping the min supported version.

Release note: None
Epic: none
@RaduBerinde RaduBerinde requested a review from dt February 7, 2023 05:14
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@dt
Copy link
Copy Markdown
Contributor

dt commented Feb 7, 2023

Thanks for picking this up!

@RaduBerinde
Copy link
Copy Markdown
Member Author

TFTR!

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Feb 7, 2023

Build succeeded:

@craig craig bot merged commit 9444613 into cockroachdb:master Feb 7, 2023
Copy link
Copy Markdown
Contributor

@andreimatei andreimatei left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained

Copy link
Copy Markdown
Contributor

@andreimatei andreimatei left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained


pkg/clusterversion/cockroach_versions.go line 757 at r1 (raw file):

		// Note that such upgrades may in fact be a *downgrade* of the logical
		// version! For example, on a cluster that is on released version 3, a dev
		// binary containing versions 1, 2, 3, and 4 started with this flag would

I think this comment would now benefit from saying what BinaryMinSupportedVersion is in this example.


pkg/clusterversion/cockroach_versions.go line 762 at r1 (raw file):

		// then on to 1000004, etc.
		for i := range rawVersionsSingleton {
			// VPrimordial versions are not offset; they don't matter for the logic

Can we delete this stanza about VPrimordial? I think the more general thing this patch does supersedes it.

@RaduBerinde
Copy link
Copy Markdown
Member Author

pkg/clusterversion/cockroach_versions.go line 762 at r1 (raw file):

Previously, andreimatei (Andrei Matei) wrote…

Can we delete this stanza about VPrimordial? I think the more general thing this patch does supersedes it.

TFTR! I'll make these change in my next change in this area.

@RaduBerinde RaduBerinde deleted the dev-offset-min-ver branch November 7, 2025 15:11
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.

4 participants