Skip to content

Commit

Permalink
upgrades: use TestingBinaryMinSupportedVersion in tests
Browse files Browse the repository at this point in the history
As described in cockroachdb#100552, it's important for this API to use
TestingBinaryMinSupportedVersion in order to correctly bootstrap on the
older version.

Removed TestFixUserfileRelatedDescriptorCorruptionUpgrade and TestPreconditionBeforeStartingAnUpgrade
since they are for 22.2 migrations.

Release note: None
  • Loading branch information
rafiss committed Apr 5, 2023
1 parent ff2c4a3 commit c2090a5
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 577 deletions.
8 changes: 0 additions & 8 deletions pkg/clusterversion/cockroach_versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,6 @@ const (
// TODODelete_V22_2SupportAssumeRoleAuth is the version where assume role authorization is
// supported in cloud storage and KMS.
TODODelete_V22_2SupportAssumeRoleAuth
// TODODelete_V22_2FixUserfileRelatedDescriptorCorruption adds a migration which uses
// heuristics to identify invalid table descriptors for userfile-related
// descriptors.
TODODelete_V22_2FixUserfileRelatedDescriptorCorruption

// V22_2 is CockroachDB v22.2. It's used for all v22.2.x patch releases.
V22_2
Expand Down Expand Up @@ -708,10 +704,6 @@ var rawVersionsSingleton = keyedVersions{
Key: TODODelete_V22_2SupportAssumeRoleAuth,
Version: roachpb.Version{Major: 22, Minor: 1, Internal: 74},
},
{
Key: TODODelete_V22_2FixUserfileRelatedDescriptorCorruption,
Version: roachpb.Version{Major: 22, Minor: 1, Internal: 76},
},
{
Key: V22_2,
Version: roachpb.Version{Major: 22, Minor: 2, Internal: 0},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func TestDeleteDescriptorsOfDroppedFunctions(t *testing.T) {
defer log.Scope(t).Close(t)

var (
v0 = clusterversion.ByKey(clusterversion.V23_1_DeleteDroppedFunctionDescriptors - 1)
v0 = clusterversion.TestingBinaryMinSupportedVersion
v1 = clusterversion.ByKey(clusterversion.V23_1_DeleteDroppedFunctionDescriptors)
)

Expand Down Expand Up @@ -186,10 +186,12 @@ func TestDeleteDescriptorsOfDroppedFunctions(t *testing.T) {
require.Equal(t, 0, cntFnToDelete)

// Make sure other descriptors are intact.
const deletedFnCount = 4
const newSystemTableCount = 6
var newTotalDescCnt int
row = tdb.QueryRow(t, `SELECT count(*) FROM system.descriptor`)
row.Scan(&newTotalDescCnt)
require.Equal(t, originalTotalDescCnt-4, newTotalDescCnt)
require.Equal(t, originalTotalDescCnt-deletedFnCount+newSystemTableCount, newTotalDescCnt)

row = tdb.QueryRow(t, countTotalDroppedFunctionQuery)
row.Scan(&cntFnToDelete)
Expand Down
144 changes: 0 additions & 144 deletions pkg/upgrade/upgrades/fix_userfile_descriptor_corruption.go

This file was deleted.

110 changes: 0 additions & 110 deletions pkg/upgrade/upgrades/fix_userfile_descriptor_corruption_test.go

This file was deleted.

88 changes: 0 additions & 88 deletions pkg/upgrade/upgrades/precondition_before_starting_an_upgrade.go

This file was deleted.

Loading

0 comments on commit c2090a5

Please sign in to comment.