From f757119428cf42c2d9fb297d1fc13ca7f7c9fa78 Mon Sep 17 00:00:00 2001 From: Lucy Zhang Date: Wed, 14 Oct 2020 21:49:05 -0400 Subject: [PATCH] clusterversion: clean up unused 19.2/20.1 cluster versions Release note: None --- pkg/clusterversion/cockroach_versions.go | 59 -------------- pkg/clusterversion/versionkey_string.go | 99 +++++++++++------------- 2 files changed, 47 insertions(+), 111 deletions(-) diff --git a/pkg/clusterversion/cockroach_versions.go b/pkg/clusterversion/cockroach_versions.go index 244e3212c5b0..732740f176a9 100644 --- a/pkg/clusterversion/cockroach_versions.go +++ b/pkg/clusterversion/cockroach_versions.go @@ -33,12 +33,8 @@ type VersionKey int const ( _ VersionKey = iota - 1 // want first named one to start at zero Version19_1 - VersionStart19_2 - VersionLearnerReplicas - VersionTopLevelForeignKeys VersionAtomicChangeReplicasTrigger VersionAtomicChangeReplicas - VersionTableDescModificationTimeFromMVCC VersionPartitionedBackup Version19_2 VersionStart20_1 @@ -50,7 +46,6 @@ const ( VersionPrimaryKeyChanges VersionAuthLocalAndTrustRejectMethods VersionPrimaryKeyColumnsOutOfFamilyZero - VersionRootPassword VersionNoExplicitForeignKeyIndexIDs VersionHashShardedIndexes VersionCreateRolePrivilege @@ -110,37 +105,6 @@ var versionsSingleton = keyedVersions([]keyedVersion{ Key: Version19_1, Version: roachpb.Version{Major: 19, Minor: 1}, }, - { - // VersionStart19_2 demarcates work towards CockroachDB v19.2. - Key: VersionStart19_2, - Version: roachpb.Version{Major: 19, Minor: 1, Unstable: 1}, - }, - { - // VersionLearnerReplicas is https://github.com/cockroachdb/cockroach/pull/38149. - Key: VersionLearnerReplicas, - Version: roachpb.Version{Major: 19, Minor: 1, Unstable: 6}, - }, - { - // VersionTopLevelForeignKeys is https://github.com/cockroachdb/cockroach/pull/39173. - // - // It represents an upgrade to the table descriptor format in which foreign - // key references are pulled out of the index descriptors where they - // originally were kept, and rewritten into a top level field on the index's - // parent table descriptors. During a mixed-version state, the database will - // write old-style table descriptors at all system boundaries, but upgrade - // all old-style table descriptors into the new format upon read. Once the - // upgrade is finalized, the database will write the upgraded format, but - // continue to upgrade old-style descriptors on-demand. - // - // This version is also used for the new foreign key schema changes which - // are run in the schema changer, requiring new types of mutations on the - // table descriptor. The same version is used for both of these changes - // because the changes are intertwined, and it slightly simplifies some of - // the logic to assume that either neither or both sets of changes can be - // active. - Key: VersionTopLevelForeignKeys, - Version: roachpb.Version{Major: 19, Minor: 1, Unstable: 7}, - }, { // VersionAtomicChangeReplicasTrigger is https://github.com/cockroachdb/cockroach/pull/39485. // @@ -160,18 +124,6 @@ var versionsSingleton = keyedVersions([]keyedVersion{ Key: VersionAtomicChangeReplicas, Version: roachpb.Version{Major: 19, Minor: 1, Unstable: 9}, }, - { - // VersionTableDescModificationTimeFromMVCC is https://github.com/cockroachdb/cockroach/pull/40581 - // - // It represents an upgrade to the table descriptor format in which - // CreateAsOfTime and ModifiedTime are set to zero when new versions of - // table descriptors are written. This removes the need to fix the commit - // timestamp for transactions which update table descriptors. The value - // is then populated by the reading client with the MVCC timestamp of the - // row which contained the serialized table descriptor. - Key: VersionTableDescModificationTimeFromMVCC, - Version: roachpb.Version{Major: 19, Minor: 1, Unstable: 10}, - }, { // VersionPartitionedBackup is https://github.com/cockroachdb/cockroach/pull/39250. Key: VersionPartitionedBackup, @@ -291,17 +243,6 @@ var versionsSingleton = keyedVersions([]keyedVersion{ Key: VersionPrimaryKeyColumnsOutOfFamilyZero, Version: roachpb.Version{Major: 19, Minor: 2, Unstable: 9}, }, - { - // VersionRootPassword enables setting a password for the `root` - // user from SQL. Even though introducing a password for the root - // user in 20.1 does not prevent 19.2 nodes from using the root - // account, we need a cluster setting: the 19.2 nodes do not even - // *check* the password, so setting a pw in a hybrid 20.1/19.2 - // cluster would yield different client auth successes in - // different nodes (which is poor UX). - Key: VersionRootPassword, - Version: roachpb.Version{Major: 19, Minor: 2, Unstable: 10}, - }, { // VersionNoExplicitForeignKeyIndexIDs is https://github.com/cockroachdb/cockroach/pull/43332. // diff --git a/pkg/clusterversion/versionkey_string.go b/pkg/clusterversion/versionkey_string.go index ec6ec6a25809..d51390813a63 100644 --- a/pkg/clusterversion/versionkey_string.go +++ b/pkg/clusterversion/versionkey_string.go @@ -9,61 +9,56 @@ func _() { // Re-run the stringer command to generate them again. var x [1]struct{} _ = x[Version19_1-0] - _ = x[VersionStart19_2-1] - _ = x[VersionLearnerReplicas-2] - _ = x[VersionTopLevelForeignKeys-3] - _ = x[VersionAtomicChangeReplicasTrigger-4] - _ = x[VersionAtomicChangeReplicas-5] - _ = x[VersionTableDescModificationTimeFromMVCC-6] - _ = x[VersionPartitionedBackup-7] - _ = x[Version19_2-8] - _ = x[VersionStart20_1-9] - _ = x[VersionContainsEstimatesCounter-10] - _ = x[VersionChangeReplicasDemotion-11] - _ = x[VersionSecondaryIndexColumnFamilies-12] - _ = x[VersionNamespaceTableWithSchemas-13] - _ = x[VersionProtectedTimestamps-14] - _ = x[VersionPrimaryKeyChanges-15] - _ = x[VersionAuthLocalAndTrustRejectMethods-16] - _ = x[VersionPrimaryKeyColumnsOutOfFamilyZero-17] - _ = x[VersionRootPassword-18] - _ = x[VersionNoExplicitForeignKeyIndexIDs-19] - _ = x[VersionHashShardedIndexes-20] - _ = x[VersionCreateRolePrivilege-21] - _ = x[VersionStatementDiagnosticsSystemTables-22] - _ = x[VersionSchemaChangeJob-23] - _ = x[VersionSavepoints-24] - _ = x[VersionTimeTZType-25] - _ = x[VersionTimePrecision-26] - _ = x[Version20_1-27] - _ = x[VersionStart20_2-28] - _ = x[VersionGeospatialType-29] - _ = x[VersionEnums-30] - _ = x[VersionRangefeedLeases-31] - _ = x[VersionAlterColumnTypeGeneral-32] - _ = x[VersionAlterSystemJobsAddCreatedByColumns-33] - _ = x[VersionAddScheduledJobsTable-34] - _ = x[VersionUserDefinedSchemas-35] - _ = x[VersionNoOriginFKIndexes-36] - _ = x[VersionClientRangeInfosOnBatchResponse-37] - _ = x[VersionNodeMembershipStatus-38] - _ = x[VersionRangeStatsRespHasDesc-39] - _ = x[VersionMinPasswordLength-40] - _ = x[VersionAbortSpanBytes-41] - _ = x[VersionAlterSystemJobsAddSqllivenessColumnsAddNewSystemSqllivenessTable-42] - _ = x[VersionMaterializedViews-43] - _ = x[VersionBox2DType-44] - _ = x[VersionLeasedDatabaseDescriptors-45] - _ = x[VersionUpdateScheduledJobsSchema-46] - _ = x[VersionCreateLoginPrivilege-47] - _ = x[VersionHBAForNonTLS-48] - _ = x[Version20_2-49] - _ = x[VersionStart21_1-50] + _ = x[VersionAtomicChangeReplicasTrigger-1] + _ = x[VersionAtomicChangeReplicas-2] + _ = x[VersionPartitionedBackup-3] + _ = x[Version19_2-4] + _ = x[VersionStart20_1-5] + _ = x[VersionContainsEstimatesCounter-6] + _ = x[VersionChangeReplicasDemotion-7] + _ = x[VersionSecondaryIndexColumnFamilies-8] + _ = x[VersionNamespaceTableWithSchemas-9] + _ = x[VersionProtectedTimestamps-10] + _ = x[VersionPrimaryKeyChanges-11] + _ = x[VersionAuthLocalAndTrustRejectMethods-12] + _ = x[VersionPrimaryKeyColumnsOutOfFamilyZero-13] + _ = x[VersionNoExplicitForeignKeyIndexIDs-14] + _ = x[VersionHashShardedIndexes-15] + _ = x[VersionCreateRolePrivilege-16] + _ = x[VersionStatementDiagnosticsSystemTables-17] + _ = x[VersionSchemaChangeJob-18] + _ = x[VersionSavepoints-19] + _ = x[VersionTimeTZType-20] + _ = x[VersionTimePrecision-21] + _ = x[Version20_1-22] + _ = x[VersionStart20_2-23] + _ = x[VersionGeospatialType-24] + _ = x[VersionEnums-25] + _ = x[VersionRangefeedLeases-26] + _ = x[VersionAlterColumnTypeGeneral-27] + _ = x[VersionAlterSystemJobsAddCreatedByColumns-28] + _ = x[VersionAddScheduledJobsTable-29] + _ = x[VersionUserDefinedSchemas-30] + _ = x[VersionNoOriginFKIndexes-31] + _ = x[VersionClientRangeInfosOnBatchResponse-32] + _ = x[VersionNodeMembershipStatus-33] + _ = x[VersionRangeStatsRespHasDesc-34] + _ = x[VersionMinPasswordLength-35] + _ = x[VersionAbortSpanBytes-36] + _ = x[VersionAlterSystemJobsAddSqllivenessColumnsAddNewSystemSqllivenessTable-37] + _ = x[VersionMaterializedViews-38] + _ = x[VersionBox2DType-39] + _ = x[VersionLeasedDatabaseDescriptors-40] + _ = x[VersionUpdateScheduledJobsSchema-41] + _ = x[VersionCreateLoginPrivilege-42] + _ = x[VersionHBAForNonTLS-43] + _ = x[Version20_2-44] + _ = x[VersionStart21_1-45] } -const _VersionKey_name = "Version19_1VersionStart19_2VersionLearnerReplicasVersionTopLevelForeignKeysVersionAtomicChangeReplicasTriggerVersionAtomicChangeReplicasVersionTableDescModificationTimeFromMVCCVersionPartitionedBackupVersion19_2VersionStart20_1VersionContainsEstimatesCounterVersionChangeReplicasDemotionVersionSecondaryIndexColumnFamiliesVersionNamespaceTableWithSchemasVersionProtectedTimestampsVersionPrimaryKeyChangesVersionAuthLocalAndTrustRejectMethodsVersionPrimaryKeyColumnsOutOfFamilyZeroVersionRootPasswordVersionNoExplicitForeignKeyIndexIDsVersionHashShardedIndexesVersionCreateRolePrivilegeVersionStatementDiagnosticsSystemTablesVersionSchemaChangeJobVersionSavepointsVersionTimeTZTypeVersionTimePrecisionVersion20_1VersionStart20_2VersionGeospatialTypeVersionEnumsVersionRangefeedLeasesVersionAlterColumnTypeGeneralVersionAlterSystemJobsAddCreatedByColumnsVersionAddScheduledJobsTableVersionUserDefinedSchemasVersionNoOriginFKIndexesVersionClientRangeInfosOnBatchResponseVersionNodeMembershipStatusVersionRangeStatsRespHasDescVersionMinPasswordLengthVersionAbortSpanBytesVersionAlterSystemJobsAddSqllivenessColumnsAddNewSystemSqllivenessTableVersionMaterializedViewsVersionBox2DTypeVersionLeasedDatabaseDescriptorsVersionUpdateScheduledJobsSchemaVersionCreateLoginPrivilegeVersionHBAForNonTLSVersion20_2VersionStart21_1" +const _VersionKey_name = "Version19_1VersionAtomicChangeReplicasTriggerVersionAtomicChangeReplicasVersionPartitionedBackupVersion19_2VersionStart20_1VersionContainsEstimatesCounterVersionChangeReplicasDemotionVersionSecondaryIndexColumnFamiliesVersionNamespaceTableWithSchemasVersionProtectedTimestampsVersionPrimaryKeyChangesVersionAuthLocalAndTrustRejectMethodsVersionPrimaryKeyColumnsOutOfFamilyZeroVersionNoExplicitForeignKeyIndexIDsVersionHashShardedIndexesVersionCreateRolePrivilegeVersionStatementDiagnosticsSystemTablesVersionSchemaChangeJobVersionSavepointsVersionTimeTZTypeVersionTimePrecisionVersion20_1VersionStart20_2VersionGeospatialTypeVersionEnumsVersionRangefeedLeasesVersionAlterColumnTypeGeneralVersionAlterSystemJobsAddCreatedByColumnsVersionAddScheduledJobsTableVersionUserDefinedSchemasVersionNoOriginFKIndexesVersionClientRangeInfosOnBatchResponseVersionNodeMembershipStatusVersionRangeStatsRespHasDescVersionMinPasswordLengthVersionAbortSpanBytesVersionAlterSystemJobsAddSqllivenessColumnsAddNewSystemSqllivenessTableVersionMaterializedViewsVersionBox2DTypeVersionLeasedDatabaseDescriptorsVersionUpdateScheduledJobsSchemaVersionCreateLoginPrivilegeVersionHBAForNonTLSVersion20_2VersionStart21_1" -var _VersionKey_index = [...]uint16{0, 11, 27, 49, 75, 109, 136, 176, 200, 211, 227, 258, 287, 322, 354, 380, 404, 441, 480, 499, 534, 559, 585, 624, 646, 663, 680, 700, 711, 727, 748, 760, 782, 811, 852, 880, 905, 929, 967, 994, 1022, 1046, 1067, 1138, 1162, 1178, 1210, 1242, 1269, 1288, 1299, 1315} +var _VersionKey_index = [...]uint16{0, 11, 45, 72, 96, 107, 123, 154, 183, 218, 250, 276, 300, 337, 376, 411, 436, 462, 501, 523, 540, 557, 577, 588, 604, 625, 637, 659, 688, 729, 757, 782, 806, 844, 871, 899, 923, 944, 1015, 1039, 1055, 1087, 1119, 1146, 1165, 1176, 1192} func (i VersionKey) String() string { if i < 0 || i >= VersionKey(len(_VersionKey_index)-1) {