From 2b730a0724e47a1fb70aab0c95c447ca8e295d7c Mon Sep 17 00:00:00 2001 From: Celia La Date: Tue, 7 Feb 2023 14:26:56 -0800 Subject: [PATCH] clusterversion: rename V22_2* gates to TODODelete_V22_2* Now that we've bumped minBinary to 22.2, 22.2 gates are now safe for deletion. This commit renames V22_2 gates to TODODelete_V22_2*. Action gate deletion and related logic/migrations will be done async by teams. Issue: #95530 Epic: CRDB-23572 Release note: None --- pkg/ccl/backupccl/datadriven_test.go | 2 +- pkg/ccl/backupccl/restore_job.go | 2 +- pkg/ccl/backupccl/restore_planning.go | 2 +- pkg/ccl/backupccl/system_schema.go | 2 +- pkg/ccl/changefeedccl/cdceval/validation.go | 4 +- pkg/cloud/amazon/aws_kms.go | 2 +- pkg/cloud/amazon/s3_storage.go | 2 +- pkg/cloud/cloudprivilege/privileges.go | 4 +- pkg/cloud/gcp/gcp_kms.go | 2 +- pkg/cloud/gcp/gcs_storage.go | 2 +- pkg/clusterversion/cockroach_versions.go | 234 +++++++++--------- .../kvclient/kvcoord/dist_sender_rangefeed.go | 2 +- .../kvcoord/dist_sender_rangefeed_test.go | 4 +- pkg/kv/kvserver/batcheval/cmd_delete_range.go | 2 +- pkg/kv/kvserver/client_lease_test.go | 6 +- pkg/kv/kvserver/replica_command.go | 6 +- pkg/kv/kvserver/replica_range_lease.go | 2 +- pkg/kv/kvserver/store_send.go | 2 +- pkg/kv/kvserver/store_snapshot.go | 2 +- pkg/server/combined_statement_stats.go | 2 +- pkg/server/statement_diagnostics_requests.go | 2 +- .../schematelemetrycontroller/controller.go | 6 +- pkg/sql/create_external_connection.go | 4 +- pkg/sql/create_function.go | 2 +- pkg/sql/create_function_test.go | 4 +- pkg/sql/create_index.go | 4 +- pkg/sql/create_role.go | 2 +- pkg/sql/delete_range.go | 2 +- pkg/sql/drop_external_connection.go | 4 +- pkg/sql/gcjob/gc_job.go | 2 +- pkg/sql/gcjob/gcjobnotifier/notifier.go | 2 +- pkg/sql/gcjob_test/gc_job_test.go | 4 +- pkg/sql/grant_revoke_system.go | 4 +- pkg/sql/importer/import_job.go | 2 +- pkg/sql/logictest/logic.go | 4 +- pkg/sql/opt_exec_factory.go | 2 +- pkg/sql/repair.go | 2 +- pkg/sql/schema_changer.go | 8 +- .../internal/scbuildstmt/alter_table.go | 8 +- .../internal/scbuildstmt/create_index.go | 4 +- .../scbuild/internal/scbuildstmt/process.go | 26 +- pkg/sql/schemachanger/scdeps/exec_deps.go | 2 +- pkg/sql/schemachanger/screl/scalars.go | 4 +- pkg/sql/sqlstats/persistedsqlstats/flush.go | 2 +- .../sqlstats/persistedsqlstats/stmt_reader.go | 2 +- .../stmtdiagnostics/statement_diagnostics.go | 4 +- pkg/sql/syntheticprivilegecache/cache.go | 2 +- pkg/sql/truncate.go | 2 +- pkg/storage/engine_test.go | 2 +- pkg/storage/mvcc.go | 2 +- pkg/storage/pebble.go | 10 +- pkg/storage/pebble_iterator_test.go | 2 +- pkg/storage/sst_writer.go | 4 +- pkg/storage/sst_writer_test.go | 6 +- .../upgrademanager/manager_external_test.go | 2 +- .../alter_sql_instances_locality_test.go | 4 +- ...t_statistics_index_recommendations_test.go | 4 +- pkg/upgrade/upgrades/builtins_test.go | 4 +- ...sure_sql_schema_telemetry_schedule_test.go | 4 +- ...fix_userfile_descriptor_corruption_test.go | 4 +- ...efore_starting_an_upgrade_external_test.go | 4 +- .../upgrades/role_options_migration_test.go | 10 +- .../sampled_stmt_diagnostics_requests_test.go | 4 +- ..._sequence_back_references_external_test.go | 4 +- ...ce_to_be_referenced_by_ID_external_test.go | 4 +- pkg/upgrade/upgrades/upgrades.go | 36 +-- .../wait_for_del_range_in_gc_job_test.go | 4 +- .../upgrades/wait_for_schema_changes_test.go | 4 +- .../schemachange/operation_generator.go | 10 +- 69 files changed, 265 insertions(+), 265 deletions(-) diff --git a/pkg/ccl/backupccl/datadriven_test.go b/pkg/ccl/backupccl/datadriven_test.go index f32a1bc018ac..1fafec6a20ae 100644 --- a/pkg/ccl/backupccl/datadriven_test.go +++ b/pkg/ccl/backupccl/datadriven_test.go @@ -79,7 +79,7 @@ var localityCfgs = map[string]roachpb.Locality{ } var clusterVersionKeys = map[string]clusterversion.Key{ - "Start22_2": clusterversion.V22_2Start, + "Start22_2": clusterversion.TODODelete_V22_2Start, } type sqlDBKey struct { diff --git a/pkg/ccl/backupccl/restore_job.go b/pkg/ccl/backupccl/restore_job.go index 256ca0cd3af3..11c0bda3f18b 100644 --- a/pkg/ccl/backupccl/restore_job.go +++ b/pkg/ccl/backupccl/restore_job.go @@ -2933,7 +2933,7 @@ VALUES ($1, $2, $3, (SELECT user_id FROM system.users WHERE username = $1), (SEL return err } - roleOptionsHasIDColumn := r.execCfg.Settings.Version.IsActive(ctx, clusterversion.V22_2RoleOptionsTableHasIDColumn) + roleOptionsHasIDColumn := r.execCfg.Settings.Version.IsActive(ctx, clusterversion.TODODelete_V22_2RoleOptionsTableHasIDColumn) insertRoleOption := `INSERT INTO system.role_options ("username", "option", "value", "user_id") VALUES ($1, $2, $3, $4)` if !roleOptionsHasIDColumn { insertRoleOption = `INSERT INTO system.role_options ("username", "option", "value") VALUES ($1, $2, $3)` diff --git a/pkg/ccl/backupccl/restore_planning.go b/pkg/ccl/backupccl/restore_planning.go index 3b7dd5626786..17894c0efc9c 100644 --- a/pkg/ccl/backupccl/restore_planning.go +++ b/pkg/ccl/backupccl/restore_planning.go @@ -991,7 +991,7 @@ func restorePlanHook( } if restoreStmt.Options.SchemaOnly && - !p.ExecCfg().Settings.Version.IsActive(ctx, clusterversion.V22_2Start) { + !p.ExecCfg().Settings.Version.IsActive(ctx, clusterversion.TODODelete_V22_2Start) { return nil, nil, nil, false, errors.New("cannot run RESTORE with schema_only until cluster has fully upgraded to 22.2") } diff --git a/pkg/ccl/backupccl/system_schema.go b/pkg/ccl/backupccl/system_schema.go index 451c16ffcf30..68d98de4159f 100644 --- a/pkg/ccl/backupccl/system_schema.go +++ b/pkg/ccl/backupccl/system_schema.go @@ -170,7 +170,7 @@ func usersRestoreFunc( txn isql.Txn, systemTableName, tempTableName string, ) (retErr error) { - if !deps.settings.Version.IsActive(ctx, clusterversion.V22_2RoleOptionsTableHasIDColumn) { + if !deps.settings.Version.IsActive(ctx, clusterversion.TODODelete_V22_2RoleOptionsTableHasIDColumn) { return defaultSystemTableRestoreFunc( ctx, deps, txn, systemTableName, tempTableName, ) diff --git a/pkg/ccl/changefeedccl/cdceval/validation.go b/pkg/ccl/changefeedccl/cdceval/validation.go index c77afddfbdce..69ed07a4e647 100644 --- a/pkg/ccl/changefeedccl/cdceval/validation.go +++ b/pkg/ccl/changefeedccl/cdceval/validation.go @@ -80,10 +80,10 @@ func normalizeAndValidateSelectForTarget( } }() - if !execCfg.Settings.Version.IsActive(ctx, clusterversion.V22_2EnablePredicateProjectionChangefeed) { + if !execCfg.Settings.Version.IsActive(ctx, clusterversion.TODODelete_V22_2EnablePredicateProjectionChangefeed) { return nil, errors.Newf( `filters and projections not supported until upgrade to version %s or higher is finalized`, - clusterversion.V22_2EnablePredicateProjectionChangefeed.String()) + clusterversion.TODODelete_V22_2EnablePredicateProjectionChangefeed.String()) } // This really shouldn't happen as it's enforced by sql.y. diff --git a/pkg/cloud/amazon/aws_kms.go b/pkg/cloud/amazon/aws_kms.go index 2c49768bd524..5ba5cfa55298 100644 --- a/pkg/cloud/amazon/aws_kms.go +++ b/pkg/cloud/amazon/aws_kms.go @@ -196,7 +196,7 @@ func MakeAWSKMS(ctx context.Context, uri string, env cloud.KMSEnv) (cloud.KMS, e } if kmsURIParams.roleProvider != (roleProvider{}) { - if !env.ClusterSettings().Version.IsActive(ctx, clusterversion.V22_2SupportAssumeRoleAuth) { + if !env.ClusterSettings().Version.IsActive(ctx, clusterversion.TODODelete_V22_2SupportAssumeRoleAuth) { return nil, errors.New("cannot authenticate to KMS via assume role until cluster has fully upgraded to 22.2") } diff --git a/pkg/cloud/amazon/s3_storage.go b/pkg/cloud/amazon/s3_storage.go index 995db3ee4bad..598c0f59c831 100644 --- a/pkg/cloud/amazon/s3_storage.go +++ b/pkg/cloud/amazon/s3_storage.go @@ -566,7 +566,7 @@ func newClient( } if conf.assumeRoleProvider.roleARN != "" { - if !settings.Version.IsActive(ctx, clusterversion.V22_2SupportAssumeRoleAuth) { + if !settings.Version.IsActive(ctx, clusterversion.TODODelete_V22_2SupportAssumeRoleAuth) { return s3Client{}, "", errors.New("cannot authenticate to cloud storage via assume role until cluster has fully upgraded to 22.2") } diff --git a/pkg/cloud/cloudprivilege/privileges.go b/pkg/cloud/cloudprivilege/privileges.go index b5014fc1c820..32b1258921a7 100644 --- a/pkg/cloud/cloudprivilege/privileges.go +++ b/pkg/cloud/cloudprivilege/privileges.go @@ -59,10 +59,10 @@ func CheckDestinationPrivileges(ctx context.Context, p sql.PlanHookState, to []s // If the resource being used is an External Connection, check that the user // has adequate privileges. if conf.Provider == cloudpb.ExternalStorageProvider_external { - if !p.ExecCfg().Settings.Version.IsActive(ctx, clusterversion.V22_2SystemExternalConnectionsTable) { + if !p.ExecCfg().Settings.Version.IsActive(ctx, clusterversion.TODODelete_V22_2SystemExternalConnectionsTable) { return pgerror.Newf(pgcode.FeatureNotSupported, "version %v must be finalized to backup to an External Connection", - clusterversion.ByKey(clusterversion.V22_2SystemExternalConnectionsTable)) + clusterversion.ByKey(clusterversion.TODODelete_V22_2SystemExternalConnectionsTable)) } ecPrivilege := &syntheticprivilege.ExternalConnectionPrivilege{ ConnectionName: conf.ExternalConnectionConfig.Name, diff --git a/pkg/cloud/gcp/gcp_kms.go b/pkg/cloud/gcp/gcp_kms.go index e20c183a623c..ef92a5e58efd 100644 --- a/pkg/cloud/gcp/gcp_kms.go +++ b/pkg/cloud/gcp/gcp_kms.go @@ -127,7 +127,7 @@ func MakeGCSKMS(ctx context.Context, uri string, env cloud.KMSEnv) (cloud.KMS, e if kmsURIParams.assumeRole == "" { opts = append(opts, credentialsOpt...) } else { - if !env.ClusterSettings().Version.IsActive(ctx, clusterversion.V22_2SupportAssumeRoleAuth) { + if !env.ClusterSettings().Version.IsActive(ctx, clusterversion.TODODelete_V22_2SupportAssumeRoleAuth) { return nil, errors.New("cannot authenticate to KMS via assume role until cluster has fully upgraded to 22.2") } diff --git a/pkg/cloud/gcp/gcs_storage.go b/pkg/cloud/gcp/gcs_storage.go index ccd7e84424bf..d085fbbd97c1 100644 --- a/pkg/cloud/gcp/gcs_storage.go +++ b/pkg/cloud/gcp/gcs_storage.go @@ -181,7 +181,7 @@ func makeGCSStorage( if conf.AssumeRole == "" { opts = append(opts, credentialsOpt...) } else { - if !args.Settings.Version.IsActive(ctx, clusterversion.V22_2SupportAssumeRoleAuth) { + if !args.Settings.Version.IsActive(ctx, clusterversion.TODODelete_V22_2SupportAssumeRoleAuth) { return nil, errors.New("cannot authenticate to cloud storage via assume role until cluster has fully upgraded to 22.2") } diff --git a/pkg/clusterversion/cockroach_versions.go b/pkg/clusterversion/cockroach_versions.go index 604c4229317c..f439b365b15a 100644 --- a/pkg/clusterversion/cockroach_versions.go +++ b/pkg/clusterversion/cockroach_versions.go @@ -176,81 +176,81 @@ const ( // to succeed without actually performing the update. VPrimordialMax - // V22_1 is CockroachDB v22.1. It's used for all v22.1.x patch releases. - V22_1 + // TODODelete_V22_1 is CockroachDB v22.1. It's used for all v22.1.x patch releases. + TODODelete_V22_1 // v22.2 versions. // - // V22_2Start demarcates work towards CockroachDB v22.2. - V22_2Start + // TODODelete_V22_2Start demarcates work towards CockroachDB v22.2. + TODODelete_V22_2Start - // V22_2LocalTimestamps enables the use of local timestamps in MVCC values. - V22_2LocalTimestamps - // V22_2PebbleFormatSplitUserKeysMarkedCompacted updates the Pebble format + // TODODelete_V22_2LocalTimestamps enables the use of local timestamps in MVCC values. + TODODelete_V22_2LocalTimestamps + // TODODelete_V22_2PebbleFormatSplitUserKeysMarkedCompacted updates the Pebble format // version that recombines all user keys that may be split across multiple // files into a single table. - V22_2PebbleFormatSplitUserKeysMarkedCompacted - // V22_2EnsurePebbleFormatVersionRangeKeys is the first step of a two-part + TODODelete_V22_2PebbleFormatSplitUserKeysMarkedCompacted + // TODODelete_V22_2EnsurePebbleFormatVersionRangeKeys is the first step of a two-part // migration that bumps Pebble's format major version to a version that // supports range keys. - V22_2EnsurePebbleFormatVersionRangeKeys - // V22_2EnablePebbleFormatVersionRangeKeys is the second of a two-part migration + TODODelete_V22_2EnsurePebbleFormatVersionRangeKeys + // TODODelete_V22_2EnablePebbleFormatVersionRangeKeys is the second of a two-part migration // and is used as the feature gate for use of range keys. Any node at this // version is guaranteed to reside in a cluster where all nodes support range // keys at the Pebble layer. - V22_2EnablePebbleFormatVersionRangeKeys - // V22_2TrigramInvertedIndexes enables the creation of trigram inverted indexes + TODODelete_V22_2EnablePebbleFormatVersionRangeKeys + // TODODelete_V22_2TrigramInvertedIndexes enables the creation of trigram inverted indexes // on strings. - V22_2TrigramInvertedIndexes - // V22_2RemoveGrantPrivilege is the last step to migrate from the GRANT privilege to WITH GRANT OPTION. - V22_2RemoveGrantPrivilege - // V22_2MVCCRangeTombstones enables the use of MVCC range tombstones. - V22_2MVCCRangeTombstones - // V22_2UpgradeSequenceToBeReferencedByID ensures that sequences are referenced + TODODelete_V22_2TrigramInvertedIndexes + // TODODelete_V22_2RemoveGrantPrivilege is the last step to migrate from the GRANT privilege to WITH GRANT OPTION. + TODODelete_V22_2RemoveGrantPrivilege + // TODODelete_V22_2MVCCRangeTombstones enables the use of MVCC range tombstones. + TODODelete_V22_2MVCCRangeTombstones + // TODODelete_V22_2UpgradeSequenceToBeReferencedByID ensures that sequences are referenced // by IDs rather than by their names. For example, a column's DEFAULT (or // ON UPDATE) expression can be defined to be 'nextval('s')'; we want to be // able to refer to sequence 's' by its ID, since 's' might be later renamed. - V22_2UpgradeSequenceToBeReferencedByID - // V22_2SampledStmtDiagReqs enables installing statement diagnostic requests that + TODODelete_V22_2UpgradeSequenceToBeReferencedByID + // TODODelete_V22_2SampledStmtDiagReqs enables installing statement diagnostic requests that // probabilistically collects stmt bundles, controlled by the user provided // sampling rate. - V22_2SampledStmtDiagReqs - // V22_2AddSSTableTombstones allows writing MVCC point tombstones via AddSSTable. + TODODelete_V22_2SampledStmtDiagReqs + // TODODelete_V22_2AddSSTableTombstones allows writing MVCC point tombstones via AddSSTable. // Previously, SSTs containing these could error. - V22_2AddSSTableTombstones - // V22_2SystemPrivilegesTable adds system.privileges table. - V22_2SystemPrivilegesTable - // V22_2EnablePredicateProjectionChangefeed indicates that changefeeds support + TODODelete_V22_2AddSSTableTombstones + // TODODelete_V22_2SystemPrivilegesTable adds system.privileges table. + TODODelete_V22_2SystemPrivilegesTable + // TODODelete_V22_2EnablePredicateProjectionChangefeed indicates that changefeeds support // predicates and projections. - V22_2EnablePredicateProjectionChangefeed - // V22_2AlterSystemSQLInstancesAddLocality adds a locality column to the + TODODelete_V22_2EnablePredicateProjectionChangefeed + // TODODelete_V22_2AlterSystemSQLInstancesAddLocality adds a locality column to the // system.sql_instances table. - V22_2AlterSystemSQLInstancesAddLocality - // V22_2SystemExternalConnectionsTable adds system.external_connections table. - V22_2SystemExternalConnectionsTable - // V22_2AlterSystemStatementStatisticsAddIndexRecommendations adds an + TODODelete_V22_2AlterSystemSQLInstancesAddLocality + // TODODelete_V22_2SystemExternalConnectionsTable adds system.external_connections table. + TODODelete_V22_2SystemExternalConnectionsTable + // TODODelete_V22_2AlterSystemStatementStatisticsAddIndexRecommendations adds an // index_recommendations column to the system.statement_statistics table. - V22_2AlterSystemStatementStatisticsAddIndexRecommendations - // V22_2RoleIDSequence is the version where the system.role_id_sequence exists. - V22_2RoleIDSequence - // V22_2AddSystemUserIDColumn is the version where the system.users table has + TODODelete_V22_2AlterSystemStatementStatisticsAddIndexRecommendations + // TODODelete_V22_2RoleIDSequence is the version where the system.role_id_sequence exists. + TODODelete_V22_2RoleIDSequence + // TODODelete_V22_2AddSystemUserIDColumn is the version where the system.users table has // a user_id column for writes only. - V22_2AddSystemUserIDColumn - // V22_2SystemUsersIDColumnIsBackfilled is the version where all users in the system.users table + TODODelete_V22_2AddSystemUserIDColumn + // TODODelete_V22_2SystemUsersIDColumnIsBackfilled is the version where all users in the system.users table // have ids. - V22_2SystemUsersIDColumnIsBackfilled - // V22_2SetSystemUsersUserIDColumnNotNull sets the user_id column in system.users to not null. - V22_2SetSystemUsersUserIDColumnNotNull - // V22_2SQLSchemaTelemetryScheduledJobs adds an automatic schedule for SQL schema + TODODelete_V22_2SystemUsersIDColumnIsBackfilled + // TODODelete_V22_2SetSystemUsersUserIDColumnNotNull sets the user_id column in system.users to not null. + TODODelete_V22_2SetSystemUsersUserIDColumnNotNull + // TODODelete_V22_2SQLSchemaTelemetryScheduledJobs adds an automatic schedule for SQL schema // telemetry logging jobs. - V22_2SQLSchemaTelemetryScheduledJobs - // V22_2SchemaChangeSupportsCreateFunction adds support of CREATE FUNCTION + TODODelete_V22_2SQLSchemaTelemetryScheduledJobs + // TODODelete_V22_2SchemaChangeSupportsCreateFunction adds support of CREATE FUNCTION // statement. - V22_2SchemaChangeSupportsCreateFunction - // V22_2DeleteRequestReturnKey is the version where the DeleteRequest began + TODODelete_V22_2SchemaChangeSupportsCreateFunction + // TODODelete_V22_2DeleteRequestReturnKey is the version where the DeleteRequest began // populating the FoundKey value in the response. - V22_2DeleteRequestReturnKey - // V22_2PebbleFormatPrePebblev1Marked performs a Pebble-level migration and + TODODelete_V22_2DeleteRequestReturnKey + // TODODelete_V22_2PebbleFormatPrePebblev1Marked performs a Pebble-level migration and // upgrades the Pebble format major version to FormatPrePebblev1Marked. This // migration occurs at the per-store level and is twofold: // - Each store is first bumped to a Pebble format major version that raises @@ -261,48 +261,48 @@ const ( // pre-Pebblev1 for a low-priority compaction. In a future release of // Cockroach (likely 23.1), a blocking migration will be run to // rewrite-compact on any remaining marked tables. - V22_2PebbleFormatPrePebblev1Marked - // V22_2RoleOptionsTableHasIDColumn is the version where the role options table + TODODelete_V22_2PebbleFormatPrePebblev1Marked + // TODODelete_V22_2RoleOptionsTableHasIDColumn is the version where the role options table // has ids. - V22_2RoleOptionsTableHasIDColumn - // V22_2RoleOptionsIDColumnIsBackfilled is the version where ids in the role options + TODODelete_V22_2RoleOptionsTableHasIDColumn + // TODODelete_V22_2RoleOptionsIDColumnIsBackfilled is the version where ids in the role options // table are backfilled. - V22_2RoleOptionsIDColumnIsBackfilled - // V22_2SetRoleOptionsUserIDColumnNotNull is the version where the role + TODODelete_V22_2RoleOptionsIDColumnIsBackfilled + // TODODelete_V22_2SetRoleOptionsUserIDColumnNotNull is the version where the role // options table id column cannot be null. This is the final step // of the system.role_options table migration. - V22_2SetRoleOptionsUserIDColumnNotNull - // V22_2UseDelRangeInGCJob enables the use of the DelRange operation in the + TODODelete_V22_2SetRoleOptionsUserIDColumnNotNull + // TODODelete_V22_2UseDelRangeInGCJob enables the use of the DelRange operation in the // GC job. Before it is enabled, the GC job uses ClearRange operations // after the job waits out the GC TTL. After it has been enabled, the // job instead issues DelRange operations at the beginning of the job // and then waits for the data to be removed automatically before removing // the descriptor and zone configurations. - V22_2UseDelRangeInGCJob - // V22_2WaitedForDelRangeInGCJob corresponds to the migration which waits for + TODODelete_V22_2UseDelRangeInGCJob + // TODODelete_V22_2WaitedForDelRangeInGCJob corresponds to the migration which waits for // the GC jobs to adopt the use of DelRange with tombstones. - V22_2WaitedForDelRangeInGCJob - // V22_2RangefeedUseOneStreamPerNode changes rangefeed implementation to use 1 RPC stream per node. - V22_2RangefeedUseOneStreamPerNode - // V22_2NoNonMVCCAddSSTable adds a migration which waits for all + TODODelete_V22_2WaitedForDelRangeInGCJob + // TODODelete_V22_2RangefeedUseOneStreamPerNode changes rangefeed implementation to use 1 RPC stream per node. + TODODelete_V22_2RangefeedUseOneStreamPerNode + // TODODelete_V22_2NoNonMVCCAddSSTable adds a migration which waits for all // schema changes to complete. After this point, no non-MVCC // AddSSTable calls will be used outside of tenant streaming. - V22_2NoNonMVCCAddSSTable - // V22_2GCHintInReplicaState adds GC hint to replica state. When this version is + TODODelete_V22_2NoNonMVCCAddSSTable + // TODODelete_V22_2GCHintInReplicaState adds GC hint to replica state. When this version is // enabled, replicas will populate GC hint and update them when necessary. - V22_2GCHintInReplicaState - // V22_2UpdateInvalidColumnIDsInSequenceBackReferences looks for invalid column + TODODelete_V22_2GCHintInReplicaState + // TODODelete_V22_2UpdateInvalidColumnIDsInSequenceBackReferences looks for invalid column // ids in sequences' back references and attempts a best-effort-based matching // to update those column IDs. - V22_2UpdateInvalidColumnIDsInSequenceBackReferences - // V22_2TTLDistSQL uses DistSQL to distribute TTL SELECT/DELETE statements to + TODODelete_V22_2UpdateInvalidColumnIDsInSequenceBackReferences + // TODODelete_V22_2TTLDistSQL uses DistSQL to distribute TTL SELECT/DELETE statements to // leaseholder nodes. - V22_2TTLDistSQL - // V22_2PrioritizeSnapshots adds prioritization to sender snapshots. When this + TODODelete_V22_2TTLDistSQL + // TODODelete_V22_2PrioritizeSnapshots adds prioritization to sender snapshots. When this // version is enabled, the receiver will look at the priority of snapshots // using the fields added in 22.2. - V22_2PrioritizeSnapshots - // V22_2EnableLeaseUpgrade version gates a change in the lease transfer protocol + TODODelete_V22_2PrioritizeSnapshots + // TODODelete_V22_2EnableLeaseUpgrade version gates a change in the lease transfer protocol // whereby we only ever transfer expiration-based leases (and have // recipients later upgrade them to the more efficient epoch based ones). // This was done to limit the effects of ill-advised lease transfers since @@ -311,14 +311,14 @@ const ( // as part of lease transfers, we don't start sending out expiration based // leases to nodes that (i) don't expect them for certain keyspans, and (ii) // don't know to upgrade them to efficient epoch-based ones. - V22_2EnableLeaseUpgrade - // V22_2SupportAssumeRoleAuth is the version where assume role authorization is + TODODelete_V22_2EnableLeaseUpgrade + // TODODelete_V22_2SupportAssumeRoleAuth is the version where assume role authorization is // supported in cloud storage and KMS. - V22_2SupportAssumeRoleAuth - // V22_2FixUserfileRelatedDescriptorCorruption adds a migration which uses + TODODelete_V22_2SupportAssumeRoleAuth + // TODODelete_V22_2FixUserfileRelatedDescriptorCorruption adds a migration which uses // heuristics to identify invalid table descriptors for userfile-related // descriptors. - V22_2FixUserfileRelatedDescriptorCorruption + TODODelete_V22_2FixUserfileRelatedDescriptorCorruption // V22_2 is CockroachDB v22.2. It's used for all v22.2.x patch releases. V22_2 @@ -474,161 +474,161 @@ var rawVersionsSingleton = keyedVersions{ Version: roachpb.Version{Major: 0, Minor: 0, Internal: 424242}, }, { - Key: V22_1, + Key: TODODelete_V22_1, Version: roachpb.Version{Major: 22, Minor: 1}, }, // v22.2 versions. Internal versions must be even. { - Key: V22_2Start, + Key: TODODelete_V22_2Start, Version: roachpb.Version{Major: 22, Minor: 1, Internal: 2}, }, { - Key: V22_2LocalTimestamps, + Key: TODODelete_V22_2LocalTimestamps, Version: roachpb.Version{Major: 22, Minor: 1, Internal: 4}, }, { - Key: V22_2PebbleFormatSplitUserKeysMarkedCompacted, + Key: TODODelete_V22_2PebbleFormatSplitUserKeysMarkedCompacted, Version: roachpb.Version{Major: 22, Minor: 1, Internal: 6}, }, { - Key: V22_2EnsurePebbleFormatVersionRangeKeys, + Key: TODODelete_V22_2EnsurePebbleFormatVersionRangeKeys, Version: roachpb.Version{Major: 22, Minor: 1, Internal: 8}, }, { - Key: V22_2EnablePebbleFormatVersionRangeKeys, + Key: TODODelete_V22_2EnablePebbleFormatVersionRangeKeys, Version: roachpb.Version{Major: 22, Minor: 1, Internal: 10}, }, { - Key: V22_2TrigramInvertedIndexes, + Key: TODODelete_V22_2TrigramInvertedIndexes, Version: roachpb.Version{Major: 22, Minor: 1, Internal: 12}, }, { - Key: V22_2RemoveGrantPrivilege, + Key: TODODelete_V22_2RemoveGrantPrivilege, Version: roachpb.Version{Major: 22, Minor: 1, Internal: 14}, }, { - Key: V22_2MVCCRangeTombstones, + Key: TODODelete_V22_2MVCCRangeTombstones, Version: roachpb.Version{Major: 22, Minor: 1, Internal: 16}, }, { - Key: V22_2UpgradeSequenceToBeReferencedByID, + Key: TODODelete_V22_2UpgradeSequenceToBeReferencedByID, Version: roachpb.Version{Major: 22, Minor: 1, Internal: 18}, }, { - Key: V22_2SampledStmtDiagReqs, + Key: TODODelete_V22_2SampledStmtDiagReqs, Version: roachpb.Version{Major: 22, Minor: 1, Internal: 20}, }, { - Key: V22_2AddSSTableTombstones, + Key: TODODelete_V22_2AddSSTableTombstones, Version: roachpb.Version{Major: 22, Minor: 1, Internal: 22}, }, { - Key: V22_2SystemPrivilegesTable, + Key: TODODelete_V22_2SystemPrivilegesTable, Version: roachpb.Version{Major: 22, Minor: 1, Internal: 24}, }, { - Key: V22_2EnablePredicateProjectionChangefeed, + Key: TODODelete_V22_2EnablePredicateProjectionChangefeed, Version: roachpb.Version{Major: 22, Minor: 1, Internal: 26}, }, { - Key: V22_2AlterSystemSQLInstancesAddLocality, + Key: TODODelete_V22_2AlterSystemSQLInstancesAddLocality, Version: roachpb.Version{Major: 22, Minor: 1, Internal: 28}, }, { - Key: V22_2SystemExternalConnectionsTable, + Key: TODODelete_V22_2SystemExternalConnectionsTable, Version: roachpb.Version{Major: 22, Minor: 1, Internal: 30}, }, { - Key: V22_2AlterSystemStatementStatisticsAddIndexRecommendations, + Key: TODODelete_V22_2AlterSystemStatementStatisticsAddIndexRecommendations, Version: roachpb.Version{Major: 22, Minor: 1, Internal: 32}, }, { - Key: V22_2RoleIDSequence, + Key: TODODelete_V22_2RoleIDSequence, Version: roachpb.Version{Major: 22, Minor: 1, Internal: 34}, }, { - Key: V22_2AddSystemUserIDColumn, + Key: TODODelete_V22_2AddSystemUserIDColumn, Version: roachpb.Version{Major: 22, Minor: 1, Internal: 36}, }, { - Key: V22_2SystemUsersIDColumnIsBackfilled, + Key: TODODelete_V22_2SystemUsersIDColumnIsBackfilled, Version: roachpb.Version{Major: 22, Minor: 1, Internal: 38}, }, { - Key: V22_2SetSystemUsersUserIDColumnNotNull, + Key: TODODelete_V22_2SetSystemUsersUserIDColumnNotNull, Version: roachpb.Version{Major: 22, Minor: 1, Internal: 40}, }, { - Key: V22_2SQLSchemaTelemetryScheduledJobs, + Key: TODODelete_V22_2SQLSchemaTelemetryScheduledJobs, Version: roachpb.Version{Major: 22, Minor: 1, Internal: 42}, }, { - Key: V22_2SchemaChangeSupportsCreateFunction, + Key: TODODelete_V22_2SchemaChangeSupportsCreateFunction, Version: roachpb.Version{Major: 22, Minor: 1, Internal: 44}, }, { - Key: V22_2DeleteRequestReturnKey, + Key: TODODelete_V22_2DeleteRequestReturnKey, Version: roachpb.Version{Major: 22, Minor: 1, Internal: 46}, }, { - Key: V22_2PebbleFormatPrePebblev1Marked, + Key: TODODelete_V22_2PebbleFormatPrePebblev1Marked, Version: roachpb.Version{Major: 22, Minor: 1, Internal: 48}, }, { - Key: V22_2RoleOptionsTableHasIDColumn, + Key: TODODelete_V22_2RoleOptionsTableHasIDColumn, Version: roachpb.Version{Major: 22, Minor: 1, Internal: 50}, }, { - Key: V22_2RoleOptionsIDColumnIsBackfilled, + Key: TODODelete_V22_2RoleOptionsIDColumnIsBackfilled, Version: roachpb.Version{Major: 22, Minor: 1, Internal: 52}, }, { - Key: V22_2SetRoleOptionsUserIDColumnNotNull, + Key: TODODelete_V22_2SetRoleOptionsUserIDColumnNotNull, Version: roachpb.Version{Major: 22, Minor: 1, Internal: 54}, }, { - Key: V22_2UseDelRangeInGCJob, + Key: TODODelete_V22_2UseDelRangeInGCJob, Version: roachpb.Version{Major: 22, Minor: 1, Internal: 56}, }, { - Key: V22_2WaitedForDelRangeInGCJob, + Key: TODODelete_V22_2WaitedForDelRangeInGCJob, Version: roachpb.Version{Major: 22, Minor: 1, Internal: 58}, }, { - Key: V22_2RangefeedUseOneStreamPerNode, + Key: TODODelete_V22_2RangefeedUseOneStreamPerNode, Version: roachpb.Version{Major: 22, Minor: 1, Internal: 60}, }, { - Key: V22_2NoNonMVCCAddSSTable, + Key: TODODelete_V22_2NoNonMVCCAddSSTable, Version: roachpb.Version{Major: 22, Minor: 1, Internal: 62}, }, { - Key: V22_2GCHintInReplicaState, + Key: TODODelete_V22_2GCHintInReplicaState, Version: roachpb.Version{Major: 22, Minor: 1, Internal: 64}, }, { - Key: V22_2UpdateInvalidColumnIDsInSequenceBackReferences, + Key: TODODelete_V22_2UpdateInvalidColumnIDsInSequenceBackReferences, Version: roachpb.Version{Major: 22, Minor: 1, Internal: 66}, }, { - Key: V22_2TTLDistSQL, + Key: TODODelete_V22_2TTLDistSQL, Version: roachpb.Version{Major: 22, Minor: 1, Internal: 68}, }, { - Key: V22_2PrioritizeSnapshots, + Key: TODODelete_V22_2PrioritizeSnapshots, Version: roachpb.Version{Major: 22, Minor: 1, Internal: 70}, }, { - Key: V22_2EnableLeaseUpgrade, + Key: TODODelete_V22_2EnableLeaseUpgrade, Version: roachpb.Version{Major: 22, Minor: 1, Internal: 72}, }, { - Key: V22_2SupportAssumeRoleAuth, + Key: TODODelete_V22_2SupportAssumeRoleAuth, Version: roachpb.Version{Major: 22, Minor: 1, Internal: 74}, }, { - Key: V22_2FixUserfileRelatedDescriptorCorruption, + Key: TODODelete_V22_2FixUserfileRelatedDescriptorCorruption, Version: roachpb.Version{Major: 22, Minor: 1, Internal: 76}, }, { diff --git a/pkg/kv/kvclient/kvcoord/dist_sender_rangefeed.go b/pkg/kv/kvclient/kvcoord/dist_sender_rangefeed.go index 15ed56b07d5c..e25dcc700671 100644 --- a/pkg/kv/kvclient/kvcoord/dist_sender_rangefeed.go +++ b/pkg/kv/kvclient/kvcoord/dist_sender_rangefeed.go @@ -187,7 +187,7 @@ func (ds *DistSender) RangeFeedSpans( g := ctxgroup.WithContext(ctx) var eventProducer rangeFeedEventProducerFactory - if ds.st.Version.IsActive(ctx, clusterversion.V22_2RangefeedUseOneStreamPerNode) && + if ds.st.Version.IsActive(ctx, clusterversion.TODODelete_V22_2RangefeedUseOneStreamPerNode) && enableMuxRangeFeed && cfg.useMuxRangeFeed { m := newRangefeedMuxer(g) eventProducer = m.startMuxRangeFeed diff --git a/pkg/kv/kvclient/kvcoord/dist_sender_rangefeed_test.go b/pkg/kv/kvclient/kvcoord/dist_sender_rangefeed_test.go index 60894a8e5b8a..9c4a00662569 100644 --- a/pkg/kv/kvclient/kvcoord/dist_sender_rangefeed_test.go +++ b/pkg/kv/kvclient/kvcoord/dist_sender_rangefeed_test.go @@ -305,7 +305,7 @@ func TestBiDirectionalRangefeedNotUsedUntilUpgradeFinalilzed(t *testing.T) { } t.Run("rangefeed-stream-disabled-prior-to-version-upgrade", func(t *testing.T) { - noRfStreamVer := clusterversion.ByKey(clusterversion.V22_2RangefeedUseOneStreamPerNode - 1) + noRfStreamVer := clusterversion.ByKey(clusterversion.TODODelete_V22_2RangefeedUseOneStreamPerNode - 1) tc, cleanup := startServerAtVer(noRfStreamVer) defer cleanup() runRangeFeed(tc) @@ -314,7 +314,7 @@ func TestBiDirectionalRangefeedNotUsedUntilUpgradeFinalilzed(t *testing.T) { t.Run("rangefeed-stream-disabled-via-environment", func(t *testing.T) { defer kvcoord.TestingSetEnableMuxRangeFeed(false)() // Even though we could use rangefeed stream, it's disabled via kill switch. - rfStreamVer := clusterversion.ByKey(clusterversion.V22_2RangefeedUseOneStreamPerNode) + rfStreamVer := clusterversion.ByKey(clusterversion.TODODelete_V22_2RangefeedUseOneStreamPerNode) tc, cleanup := startServerAtVer(rfStreamVer) defer cleanup() runRangeFeed(tc, kvcoord.WithMuxRangeFeed()) diff --git a/pkg/kv/kvserver/batcheval/cmd_delete_range.go b/pkg/kv/kvserver/batcheval/cmd_delete_range.go index a418541769ad..3db8d6bb5959 100644 --- a/pkg/kv/kvserver/batcheval/cmd_delete_range.go +++ b/pkg/kv/kvserver/batcheval/cmd_delete_range.go @@ -137,7 +137,7 @@ func DeleteRange( return nil } canUseGCHint := cArgs.EvalCtx.ClusterSettings().Version.IsActive(ctx, - clusterversion.V22_2GCHintInReplicaState) + clusterversion.TODODelete_V22_2GCHintInReplicaState) if updated, err := sl.SetGCHint(ctx, readWriter, cArgs.Stats, hint, canUseGCHint); err != nil || !updated { return err } diff --git a/pkg/kv/kvserver/client_lease_test.go b/pkg/kv/kvserver/client_lease_test.go index 2111c5e16db9..90606f6cb6cc 100644 --- a/pkg/kv/kvserver/client_lease_test.go +++ b/pkg/kv/kvserver/client_lease_test.go @@ -1523,7 +1523,7 @@ func TestLeaseUpgradeVersionGate(t *testing.T) { ctx := context.Background() st := cluster.MakeTestingClusterSettingsWithVersions( clusterversion.TestingBinaryVersion, - clusterversion.ByKey(clusterversion.V22_2EnableLeaseUpgrade-1), + clusterversion.ByKey(clusterversion.TODODelete_V22_2EnableLeaseUpgrade-1), false, /* initializeVersion */ ) tci := serverutils.StartNewTestCluster(t, 2, base.TestClusterArgs{ @@ -1533,7 +1533,7 @@ func TestLeaseUpgradeVersionGate(t *testing.T) { Knobs: base.TestingKnobs{ Server: &server.TestingKnobs{ DisableAutomaticVersionUpgrade: make(chan struct{}), - BinaryVersionOverride: clusterversion.ByKey(clusterversion.V22_2EnableLeaseUpgrade - 1), + BinaryVersionOverride: clusterversion.ByKey(clusterversion.TODODelete_V22_2EnableLeaseUpgrade - 1), }, }, }, @@ -1564,7 +1564,7 @@ func TestLeaseUpgradeVersionGate(t *testing.T) { // Enable the version gate. _, err := tc.Conns[0].ExecContext(ctx, `SET CLUSTER SETTING version = $1`, - clusterversion.ByKey(clusterversion.V22_2EnableLeaseUpgrade).String()) + clusterversion.ByKey(clusterversion.TODODelete_V22_2EnableLeaseUpgrade).String()) require.NoError(t, err) // Transfer the lease back from n2 to n1. It should be transferred as an diff --git a/pkg/kv/kvserver/replica_command.go b/pkg/kv/kvserver/replica_command.go index e6129048b450..769bb983dfe2 100644 --- a/pkg/kv/kvserver/replica_command.go +++ b/pkg/kv/kvserver/replica_command.go @@ -225,7 +225,7 @@ func splitTxnAttempt( return err } - gcHintsAllowed := store.ClusterSettings().Version.IsActive(ctx, clusterversion.V22_2GCHintInReplicaState) + gcHintsAllowed := store.ClusterSettings().Version.IsActive(ctx, clusterversion.TODODelete_V22_2GCHintInReplicaState) // End the transaction manually, instead of letting RunTransaction // loop do it, in order to provide a split trigger. @@ -761,7 +761,7 @@ func (r *Replica) AdminMerge( return errors.Wrap(err, "waiting for all right-hand replicas to catch up") } - gcHintsAllowed := r.ClusterSettings().Version.IsActive(ctx, clusterversion.V22_2GCHintInReplicaState) + gcHintsAllowed := r.ClusterSettings().Version.IsActive(ctx, clusterversion.TODODelete_V22_2GCHintInReplicaState) // Successful subsume, so we're guaranteed that the right-hand range will // not serve another request unless this transaction aborts. End the @@ -2796,7 +2796,7 @@ func (r *Replica) sendSnapshotUsingDelegate( // them or the setting is disabled. TODO(baptist): Remove the version flag in // v23.1. Consider removing the cluster setting once we have verified this // works as expected in all cases. - if !r.store.ClusterSettings().Version.IsActive(ctx, clusterversion.V22_2PrioritizeSnapshots) || + if !r.store.ClusterSettings().Version.IsActive(ctx, clusterversion.TODODelete_V22_2PrioritizeSnapshots) || !snapshotPrioritizationEnabled.Get(&r.store.ClusterSettings().SV) { senderQueueName = 0 senderQueuePriority = 0 diff --git a/pkg/kv/kvserver/replica_range_lease.go b/pkg/kv/kvserver/replica_range_lease.go index 7ba6e58e81f5..9cff7cb1116c 100644 --- a/pkg/kv/kvserver/replica_range_lease.go +++ b/pkg/kv/kvserver/replica_range_lease.go @@ -259,7 +259,7 @@ func (p *pendingLeaseRequest) InitOrJoinRequest( if p.repl.requiresExpiringLeaseRLocked() || (transfer && transferExpirationLeasesFirstEnabled.Get(&p.repl.store.ClusterSettings().SV) && - p.repl.store.ClusterSettings().Version.IsActive(ctx, clusterversion.V22_2EnableLeaseUpgrade)) { + p.repl.store.ClusterSettings().Version.IsActive(ctx, clusterversion.TODODelete_V22_2EnableLeaseUpgrade)) { // In addition to ranges that unconditionally require expiration-based // leases (node liveness and earlier), we also use them during lease // transfers for all other ranges. After acquiring these expiration diff --git a/pkg/kv/kvserver/store_send.go b/pkg/kv/kvserver/store_send.go index 9431c5595b86..faf56e8542ad 100644 --- a/pkg/kv/kvserver/store_send.go +++ b/pkg/kv/kvserver/store_send.go @@ -91,7 +91,7 @@ func (s *Store) SendWithWriteBytes( // local node's clock to a high water mark from all nodes with which it has // interacted. baClockTS := ba.Now - if baClockTS.IsEmpty() && !s.ClusterSettings().Version.IsActive(ctx, clusterversion.V22_2LocalTimestamps) { + if baClockTS.IsEmpty() && !s.ClusterSettings().Version.IsActive(ctx, clusterversion.TODODelete_V22_2LocalTimestamps) { // TODO(nvanbenschoten): remove this in v23.1. v21.2 nodes will still send // requests without a Now field. This is not necessary for correctness now // that local timestamps pulled from the leaseholder's own HLC are used in diff --git a/pkg/kv/kvserver/store_snapshot.go b/pkg/kv/kvserver/store_snapshot.go index 6768b2efcded..0ef6dfa79b0d 100644 --- a/pkg/kv/kvserver/store_snapshot.go +++ b/pkg/kv/kvserver/store_snapshot.go @@ -1361,7 +1361,7 @@ func SendEmptySnapshot( return err } - supportsGCHints := st.Version.IsActive(ctx, clusterversion.V22_2GCHintInReplicaState) + supportsGCHints := st.Version.IsActive(ctx, clusterversion.TODODelete_V22_2GCHintInReplicaState) // SendEmptySnapshot is only used by the cockroach debug reset-quorum tool. // It is experimental and unlikely to be used in cluster versions that are // older than GCHintInReplicaState. We do not want the cluster version to diff --git a/pkg/server/combined_statement_stats.go b/pkg/server/combined_statement_stats.go index 3e7bac42d6fe..4d2da360c3ee 100644 --- a/pkg/server/combined_statement_stats.go +++ b/pkg/server/combined_statement_stats.go @@ -739,7 +739,7 @@ func getStatementDetailsPerPlanHash( LIMIT $%d`, whereClause, len(args)+1) expectedNumDatums := 6 - if settings.Version.IsActive(ctx, clusterversion.V22_2AlterSystemStatementStatisticsAddIndexRecommendations) { + if settings.Version.IsActive(ctx, clusterversion.TODODelete_V22_2AlterSystemStatementStatisticsAddIndexRecommendations) { query = fmt.Sprintf( `SELECT plan_hash, diff --git a/pkg/server/statement_diagnostics_requests.go b/pkg/server/statement_diagnostics_requests.go index 724f612705e6..a9a04fbe0fc1 100644 --- a/pkg/server/statement_diagnostics_requests.go +++ b/pkg/server/statement_diagnostics_requests.go @@ -138,7 +138,7 @@ func (s *statusServer) StatementDiagnosticsRequests( // TODO(irfansharif): Remove this version gating in 23.1. var extraColumns string - if s.st.Version.IsActive(ctx, clusterversion.V22_2SampledStmtDiagReqs) { + if s.st.Version.IsActive(ctx, clusterversion.TODODelete_V22_2SampledStmtDiagReqs) { extraColumns = `, sampling_probability` } diff --git a/pkg/sql/catalog/schematelemetry/schematelemetrycontroller/controller.go b/pkg/sql/catalog/schematelemetry/schematelemetrycontroller/controller.go index afe278b5627a..afe7e98bdc0c 100644 --- a/pkg/sql/catalog/schematelemetry/schematelemetrycontroller/controller.go +++ b/pkg/sql/catalog/schematelemetry/schematelemetrycontroller/controller.go @@ -134,7 +134,7 @@ func (c *Controller) Start(ctx context.Context, stopper *stop.Stopper) { }) } // Trigger a schedule update to ensure it exists at startup. - if c.st.Version.IsActive(ctx, clusterversion.V22_2SQLSchemaTelemetryScheduledJobs) { + if c.st.Version.IsActive(ctx, clusterversion.TODODelete_V22_2SQLSchemaTelemetryScheduledJobs) { notify("ensure-at-startup") } // Add a change hook on the recurrence cluster setting that will notify @@ -145,7 +145,7 @@ func (c *Controller) Start(ctx context.Context, stopper *stop.Stopper) { } func updateSchedule(ctx context.Context, db isql.DB, st *cluster.Settings, clusterID uuid.UUID) { - if !st.Version.IsActive(ctx, clusterversion.V22_2SQLSchemaTelemetryScheduledJobs) { + if !st.Version.IsActive(ctx, clusterversion.TODODelete_V22_2SQLSchemaTelemetryScheduledJobs) { log.Infof(ctx, "failed to update SQL schema telemetry schedule: %s", ErrVersionGate) } retryOptions := retry.Options{ @@ -223,7 +223,7 @@ var cronExprRewrites = map[string]func(r *rand.Rand) string{ func (c *Controller) CreateSchemaTelemetryJob( ctx context.Context, createdByName string, createdByID int64, ) (id int64, _ error) { - if !c.st.Version.IsActive(ctx, clusterversion.V22_2SQLSchemaTelemetryScheduledJobs) { + if !c.st.Version.IsActive(ctx, clusterversion.TODODelete_V22_2SQLSchemaTelemetryScheduledJobs) { return 0, ErrVersionGate } var j *jobs.Job diff --git a/pkg/sql/create_external_connection.go b/pkg/sql/create_external_connection.go index 5e45f5bc9965..051463d7f5de 100644 --- a/pkg/sql/create_external_connection.go +++ b/pkg/sql/create_external_connection.go @@ -68,10 +68,10 @@ func (p *planner) parseExternalConnection( func (p *planner) createExternalConnection( params runParams, n *tree.CreateExternalConnection, ) error { - if !p.ExecCfg().Settings.Version.IsActive(params.ctx, clusterversion.V22_2SystemExternalConnectionsTable) { + if !p.ExecCfg().Settings.Version.IsActive(params.ctx, clusterversion.TODODelete_V22_2SystemExternalConnectionsTable) { return pgerror.Newf(pgcode.FeatureNotSupported, "version %v must be finalized to create an External Connection", - clusterversion.ByKey(clusterversion.V22_2SystemExternalConnectionsTable)) + clusterversion.ByKey(clusterversion.TODODelete_V22_2SystemExternalConnectionsTable)) } if err := params.p.CheckPrivilege(params.ctx, syntheticprivilege.GlobalPrivilegeObject, diff --git a/pkg/sql/create_function.go b/pkg/sql/create_function.go index 275b0f7b9bcc..370a45e41dce 100644 --- a/pkg/sql/create_function.go +++ b/pkg/sql/create_function.go @@ -46,7 +46,7 @@ func (n *createFunctionNode) ReadingOwnWrites() {} func (n *createFunctionNode) startExec(params runParams) error { if !params.EvalContext().Settings.Version.IsActive( params.ctx, - clusterversion.V22_2SchemaChangeSupportsCreateFunction, + clusterversion.TODODelete_V22_2SchemaChangeSupportsCreateFunction, ) { // TODO(chengxiong): remove this version gate in 23.1. return pgerror.Newf( diff --git a/pkg/sql/create_function_test.go b/pkg/sql/create_function_test.go index 9624115e580d..24fcc5c4f96c 100644 --- a/pkg/sql/create_function_test.go +++ b/pkg/sql/create_function_test.go @@ -163,7 +163,7 @@ func TestGatingCreateFunction(t *testing.T) { // Override binary version to be older. params.Knobs.Server = &server.TestingKnobs{ DisableAutomaticVersionUpgrade: make(chan struct{}), - BinaryVersionOverride: clusterversion.ByKey(clusterversion.V22_2SchemaChangeSupportsCreateFunction), + BinaryVersionOverride: clusterversion.ByKey(clusterversion.TODODelete_V22_2SchemaChangeSupportsCreateFunction), } s, sqlDB, _ := serverutils.StartServer(t, params) @@ -178,7 +178,7 @@ func TestGatingCreateFunction(t *testing.T) { // Override binary version to be older. params.Knobs.Server = &server.TestingKnobs{ DisableAutomaticVersionUpgrade: make(chan struct{}), - BinaryVersionOverride: clusterversion.ByKey(clusterversion.V22_2SchemaChangeSupportsCreateFunction - 1), + BinaryVersionOverride: clusterversion.ByKey(clusterversion.TODODelete_V22_2SchemaChangeSupportsCreateFunction - 1), } s, sqlDB, _ := serverutils.StartServer(t, params) diff --git a/pkg/sql/create_index.go b/pkg/sql/create_index.go index 42df6c594ccd..b24733d2718b 100644 --- a/pkg/sql/create_index.go +++ b/pkg/sql/create_index.go @@ -391,10 +391,10 @@ func populateInvertedIndexDescriptor( // we're going to inverted index. switch invCol.OpClass { case "gin_trgm_ops", "gist_trgm_ops": - if !cs.Version.IsActive(ctx, clusterversion.V22_2TrigramInvertedIndexes) { + if !cs.Version.IsActive(ctx, clusterversion.TODODelete_V22_2TrigramInvertedIndexes) { return pgerror.Newf(pgcode.FeatureNotSupported, "version %v must be finalized to create trigram inverted indexes", - clusterversion.ByKey(clusterversion.V22_2TrigramInvertedIndexes)) + clusterversion.ByKey(clusterversion.TODODelete_V22_2TrigramInvertedIndexes)) } case "": return errors.WithHint( diff --git a/pkg/sql/create_role.go b/pkg/sql/create_role.go index c0ad36b91d9e..0ddfaf55e8fb 100644 --- a/pkg/sql/create_role.go +++ b/pkg/sql/create_role.go @@ -202,7 +202,7 @@ func updateRoleOptions( roleName username.SQLUsername, telemetryOp string, ) (rowsAffected int, err error) { - withID := params.p.ExecCfg().Settings.Version.IsActive(params.ctx, clusterversion.V22_2RoleOptionsTableHasIDColumn) + withID := params.p.ExecCfg().Settings.Version.IsActive(params.ctx, clusterversion.TODODelete_V22_2RoleOptionsTableHasIDColumn) // Get a map of statements to execute for role options and their values. stmts, err := roleOptions.GetSQLStmts(func(o roleoption.Option) { sqltelemetry.IncIAMOptionCounter(telemetryOp, strings.ToLower(o.String())) diff --git a/pkg/sql/delete_range.go b/pkg/sql/delete_range.go index 4ab7757da5a0..3af59bd8d858 100644 --- a/pkg/sql/delete_range.go +++ b/pkg/sql/delete_range.go @@ -166,7 +166,7 @@ func (d *deleteRangeNode) startExec(params runParams) error { func (d *deleteRangeNode) deleteSpans(params runParams, b *kv.Batch, spans roachpb.Spans) { ctx := params.ctx traceKV := params.p.ExtendedEvalContext().Tracing.KVTracingEnabled() - canUsePointDelete := params.ExecCfg().Settings.Version.IsActive(ctx, clusterversion.V22_2DeleteRequestReturnKey) + canUsePointDelete := params.ExecCfg().Settings.Version.IsActive(ctx, clusterversion.TODODelete_V22_2DeleteRequestReturnKey) for _, span := range spans { if span.EndKey == nil && canUsePointDelete { if traceKV { diff --git a/pkg/sql/drop_external_connection.go b/pkg/sql/drop_external_connection.go index 25274035ca5a..d3e42132995c 100644 --- a/pkg/sql/drop_external_connection.go +++ b/pkg/sql/drop_external_connection.go @@ -41,10 +41,10 @@ func (c *dropExternalConnectionNode) startExec(params runParams) error { } func (p *planner) dropExternalConnection(params runParams, n *tree.DropExternalConnection) error { - if !p.ExecCfg().Settings.Version.IsActive(params.ctx, clusterversion.V22_2SystemExternalConnectionsTable) { + if !p.ExecCfg().Settings.Version.IsActive(params.ctx, clusterversion.TODODelete_V22_2SystemExternalConnectionsTable) { return pgerror.Newf(pgcode.FeatureNotSupported, "External Connections are not supported until upgrade to version %v is finalized", - clusterversion.ByKey(clusterversion.V22_2SystemExternalConnectionsTable)) + clusterversion.ByKey(clusterversion.TODODelete_V22_2SystemExternalConnectionsTable)) } // TODO(adityamaru): Add some metrics to track DROP EXTERNAL CONNECTION diff --git a/pkg/sql/gcjob/gc_job.go b/pkg/sql/gcjob/gc_job.go index e1de8442585c..c20ef5de7859 100644 --- a/pkg/sql/gcjob/gc_job.go +++ b/pkg/sql/gcjob/gc_job.go @@ -507,7 +507,7 @@ func shouldUseDelRange( ) bool { // TODO(ajwerner): Adopt the DeleteRange protocol for tenant GC. return details.Tenant == nil && - s.Version.IsActive(ctx, clusterversion.V22_2UseDelRangeInGCJob) && + s.Version.IsActive(ctx, clusterversion.TODODelete_V22_2UseDelRangeInGCJob) && (storage.CanUseMVCCRangeTombstones(ctx, s) || // Allow this testing knob to override the storage setting, for convenience. knobs.SkipWaitingForMVCCGC) diff --git a/pkg/sql/gcjob/gcjobnotifier/notifier.go b/pkg/sql/gcjob/gcjobnotifier/notifier.go index bfc9ea3606f0..1e2a5e86f80f 100644 --- a/pkg/sql/gcjob/gcjobnotifier/notifier.go +++ b/pkg/sql/gcjob/gcjobnotifier/notifier.go @@ -147,7 +147,7 @@ func (n *Notifier) run(_ context.Context) { systemConfigUpdateCh, _ := n.provider.RegisterSystemConfigChannel() var haveNotified syncutil.AtomicBool versionSettingChanged := make(chan struct{}, 1) - versionBeingWaited := clusterversion.ByKey(clusterversion.V22_2UseDelRangeInGCJob) + versionBeingWaited := clusterversion.ByKey(clusterversion.TODODelete_V22_2UseDelRangeInGCJob) n.settings.Version.SetOnChange(func(ctx context.Context, newVersion clusterversion.ClusterVersion) { if !haveNotified.Get() && versionBeingWaited.LessEq(newVersion.Version) && diff --git a/pkg/sql/gcjob_test/gc_job_test.go b/pkg/sql/gcjob_test/gc_job_test.go index 30e672ea29fe..8ce019a52492 100644 --- a/pkg/sql/gcjob_test/gc_job_test.go +++ b/pkg/sql/gcjob_test/gc_job_test.go @@ -675,8 +675,8 @@ func TestGCJobNoSystemConfig(t *testing.T) { provider := fakeSystemConfigProvider{} var ( - v0 = clusterversion.ByKey(clusterversion.V22_2UseDelRangeInGCJob - 1) - v1 = clusterversion.ByKey(clusterversion.V22_2UseDelRangeInGCJob) + v0 = clusterversion.ByKey(clusterversion.TODODelete_V22_2UseDelRangeInGCJob - 1) + v1 = clusterversion.ByKey(clusterversion.TODODelete_V22_2UseDelRangeInGCJob) ) settings := cluster.MakeTestingClusterSettingsWithVersions(v1, v0, false /* initializeVersion */) ctx := context.Background() diff --git a/pkg/sql/grant_revoke_system.go b/pkg/sql/grant_revoke_system.go index 38976eeac2dc..cc404d9bb271 100644 --- a/pkg/sql/grant_revoke_system.go +++ b/pkg/sql/grant_revoke_system.go @@ -214,9 +214,9 @@ func (n *changeNonDescriptorBackedPrivilegesNode) makeSystemPrivilegeObject( } return ret, nil case privilege.ExternalConnection: - if !p.ExecCfg().Settings.Version.IsActive(ctx, clusterversion.V22_2SystemExternalConnectionsTable) { + if !p.ExecCfg().Settings.Version.IsActive(ctx, clusterversion.TODODelete_V22_2SystemExternalConnectionsTable) { return nil, errors.Newf("External Connections are not supported until upgrade to version %s is finalized", - clusterversion.V22_2SystemExternalConnectionsTable.String()) + clusterversion.TODODelete_V22_2SystemExternalConnectionsTable.String()) } var ret []syntheticprivilege.Object diff --git a/pkg/sql/importer/import_job.go b/pkg/sql/importer/import_job.go index e539826cb01a..ff7cf7e4027c 100644 --- a/pkg/sql/importer/import_job.go +++ b/pkg/sql/importer/import_job.go @@ -264,7 +264,7 @@ func (r *importResumer) Resume(ctx context.Context, execCtx interface{}) error { return errors.Wrap(err, "checking if existing table is empty") } details.Tables[i].WasEmpty = len(res) == 0 - if p.ExecCfg().Settings.Version.IsActive(ctx, clusterversion.V22_2Start) { + if p.ExecCfg().Settings.Version.IsActive(ctx, clusterversion.TODODelete_V22_2Start) { // Update the descriptor in the job record and in the database with the ImportStartTime details.Tables[i].Desc.ImportStartWallTime = details.Walltime err := bindImportStartTime(ctx, p, tblDesc.GetID(), details.Walltime) diff --git a/pkg/sql/logictest/logic.go b/pkg/sql/logictest/logic.go index 25e345513e52..5dae16b33f46 100644 --- a/pkg/sql/logictest/logic.go +++ b/pkg/sql/logictest/logic.go @@ -1334,9 +1334,9 @@ func (t *logicTest) newCluster( tempStorageDiskLimit := int64(512 << 20) /* 512 MiB */ // MVCC range tombstones are only available in 22.2 or newer. supportsMVCCRangeTombstones := (t.cfg.BootstrapVersion.Equal(roachpb.Version{}) || - !t.cfg.BootstrapVersion.Less(clusterversion.ByKey(clusterversion.V22_2SetSystemUsersUserIDColumnNotNull))) && + !t.cfg.BootstrapVersion.Less(clusterversion.ByKey(clusterversion.TODODelete_V22_2SetSystemUsersUserIDColumnNotNull))) && (t.cfg.BinaryVersion.Equal(roachpb.Version{}) || - !t.cfg.BinaryVersion.Less(clusterversion.ByKey(clusterversion.V22_2SetSystemUsersUserIDColumnNotNull))) + !t.cfg.BinaryVersion.Less(clusterversion.ByKey(clusterversion.TODODelete_V22_2SetSystemUsersUserIDColumnNotNull))) shouldUseMVCCRangeTombstonesForPointDeletes := useMVCCRangeTombstonesForPointDeletes && !serverArgs.DisableUseMVCCRangeTombstonesForPointDeletes ignoreMVCCRangeTombstoneErrors := supportsMVCCRangeTombstones && (globalMVCCRangeTombstone || shouldUseMVCCRangeTombstonesForPointDeletes) diff --git a/pkg/sql/opt_exec_factory.go b/pkg/sql/opt_exec_factory.go index 4e0a80d6f7e6..e2a278a026a9 100644 --- a/pkg/sql/opt_exec_factory.go +++ b/pkg/sql/opt_exec_factory.go @@ -1761,7 +1761,7 @@ func (ef *execFactory) ConstructDeleteRange( splitter := span.NoopSplitter() canUsePointDelete := ef.planner.ExecCfg().Settings.Version.IsActive( - ef.ctx, clusterversion.V22_2DeleteRequestReturnKey, + ef.ctx, clusterversion.TODODelete_V22_2DeleteRequestReturnKey, ) if canUsePointDelete { splitter = span.MakeSplitterForDelete( diff --git a/pkg/sql/repair.go b/pkg/sql/repair.go index d0ecae9468fb..65a726b473a2 100644 --- a/pkg/sql/repair.go +++ b/pkg/sql/repair.go @@ -741,7 +741,7 @@ func (p *planner) ForceDeleteTableData(ctx context.Context, descID int64) error Key: tableSpan.Key, EndKey: tableSpan.EndKey, } b := &kv.Batch{} - if p.execCfg.Settings.Version.IsActive(ctx, clusterversion.V22_2UseDelRangeInGCJob) && + if p.execCfg.Settings.Version.IsActive(ctx, clusterversion.TODODelete_V22_2UseDelRangeInGCJob) && storage.CanUseMVCCRangeTombstones(ctx, p.execCfg.Settings) { b.AddRawRequest(&roachpb.DeleteRangeRequest{ RequestHeader: requestHeader, diff --git a/pkg/sql/schema_changer.go b/pkg/sql/schema_changer.go index 2d976eb66699..8d1dc65b9682 100644 --- a/pkg/sql/schema_changer.go +++ b/pkg/sql/schema_changer.go @@ -736,7 +736,7 @@ func (sc *SchemaChanger) exec(ctx context.Context) error { sc.job.Payload().UsernameProto.Decode(), sc.job.Payload().Description, gcDetails, - !sc.settings.Version.IsActive(ctx, clusterversion.V22_2UseDelRangeInGCJob), + !sc.settings.Version.IsActive(ctx, clusterversion.TODODelete_V22_2UseDelRangeInGCJob), ); err != nil { return err } @@ -1072,7 +1072,7 @@ func (sc *SchemaChanger) rollbackSchemaChange(ctx context.Context, err error) er }, }, }, - !sc.settings.Version.IsActive(ctx, clusterversion.V22_2UseDelRangeInGCJob), + !sc.settings.Version.IsActive(ctx, clusterversion.TODODelete_V22_2UseDelRangeInGCJob), ) if _, err := sc.jobRegistry.CreateJobWithTxn(ctx, jobRecord, gcJobID, txn); err != nil { return err @@ -1282,7 +1282,7 @@ func (sc *SchemaChanger) createIndexGCJobWithDropTime( gcJobRecord := CreateGCJobRecord( jobDesc, sc.job.Payload().UsernameProto.Decode(), indexGCDetails, - !sc.settings.Version.IsActive(ctx, clusterversion.V22_2UseDelRangeInGCJob), + !sc.settings.Version.IsActive(ctx, clusterversion.TODODelete_V22_2UseDelRangeInGCJob), ) jobID := sc.jobRegistry.MakeJobID() if _, err := sc.jobRegistry.CreateJobWithTxn(ctx, gcJobRecord, jobID, txn); err != nil { @@ -2753,7 +2753,7 @@ func (r schemaChangeResumer) Resume(ctx context.Context, execCtx interface{}) er r.job.Payload().Description, multiTableGCDetails, !p.ExecCfg().Settings.Version.IsActive( - ctx, clusterversion.V22_2UseDelRangeInGCJob, + ctx, clusterversion.TODODelete_V22_2UseDelRangeInGCJob, ), ); err != nil { return err diff --git a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table.go b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table.go index 8dd1b4726c91..94f3df991225 100644 --- a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table.go +++ b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table.go @@ -45,9 +45,9 @@ type supportedAlterTableCommand struct { // declarative schema changer. Operations marked as non-fully supported can // only be with the use_declarative_schema_changer session variable. var supportedAlterTableStatements = map[reflect.Type]supportedAlterTableCommand{ - reflect.TypeOf((*tree.AlterTableAddColumn)(nil)): {fn: alterTableAddColumn, on: true, minSupportedClusterVersion: clusterversion.V22_2Start}, - reflect.TypeOf((*tree.AlterTableDropColumn)(nil)): {fn: alterTableDropColumn, on: true, minSupportedClusterVersion: clusterversion.V22_2Start}, - reflect.TypeOf((*tree.AlterTableAlterPrimaryKey)(nil)): {fn: alterTableAlterPrimaryKey, on: true, minSupportedClusterVersion: clusterversion.V22_2Start}, + reflect.TypeOf((*tree.AlterTableAddColumn)(nil)): {fn: alterTableAddColumn, on: true, minSupportedClusterVersion: clusterversion.TODODelete_V22_2Start}, + reflect.TypeOf((*tree.AlterTableDropColumn)(nil)): {fn: alterTableDropColumn, on: true, minSupportedClusterVersion: clusterversion.TODODelete_V22_2Start}, + reflect.TypeOf((*tree.AlterTableAlterPrimaryKey)(nil)): {fn: alterTableAlterPrimaryKey, on: true, minSupportedClusterVersion: clusterversion.TODODelete_V22_2Start}, reflect.TypeOf((*tree.AlterTableSetNotNull)(nil)): {fn: alterTableSetNotNull, on: true, minSupportedClusterVersion: clusterversion.V23_1}, reflect.TypeOf((*tree.AlterTableAddConstraint)(nil)): {fn: alterTableAddConstraint, on: true, extraChecks: func( t *tree.AlterTableAddConstraint, @@ -80,7 +80,7 @@ var supportedAlterTableStatements = map[reflect.Type]supportedAlterTableCommand{ // They key is constructed as "ADD" + constraint type + validation behavior, joined with "_". // E.g. "ADD_PRIMARY_KEY_DEFAULT", "ADD_CHECK_SKIP", "ADD_FOREIGN_KEY_DEFAULT", etc. var alterTableAddConstraintMinSupportedClusterVersion = map[string]clusterversion.Key{ - "ADD_PRIMARY_KEY_DEFAULT": clusterversion.V22_2Start, + "ADD_PRIMARY_KEY_DEFAULT": clusterversion.TODODelete_V22_2Start, "ADD_CHECK_DEFAULT": clusterversion.V23_1Start, "ADD_FOREIGN_KEY_DEFAULT": clusterversion.V23_1Start, "ADD_UNIQUE_WITHOUT_INDEX_DEFAULT": clusterversion.V23_1Start, diff --git a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/create_index.go b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/create_index.go index f853c73c7e29..fa4b36bea834 100644 --- a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/create_index.go +++ b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/create_index.go @@ -346,10 +346,10 @@ func processColNodeType( // we're going to inverted index. switch columnNode.OpClass { case "gin_trgm_ops", "gist_trgm_ops": - if !b.EvalCtx().Settings.Version.IsActive(b, clusterversion.V22_2TrigramInvertedIndexes) { + if !b.EvalCtx().Settings.Version.IsActive(b, clusterversion.TODODelete_V22_2TrigramInvertedIndexes) { panic(pgerror.Newf(pgcode.FeatureNotSupported, "version %v must be finalized to create trigram inverted indexes", - clusterversion.ByKey(clusterversion.V22_2TrigramInvertedIndexes))) + clusterversion.ByKey(clusterversion.TODODelete_V22_2TrigramInvertedIndexes))) } case "": panic(errors.WithHint( diff --git a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/process.go b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/process.go index b97abd8cf879..a372fb015a4c 100644 --- a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/process.go +++ b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/process.go @@ -89,19 +89,19 @@ var supportedStatements = map[reflect.Type]supportedStatement{ // here. reflect.TypeOf((*tree.AlterTable)(nil)): {fn: AlterTable, on: true, extraChecks: alterTableIsSupported}, reflect.TypeOf((*tree.CreateIndex)(nil)): {fn: CreateIndex, on: true, minSupportedClusterVersion: clusterversion.V23_1Start}, - reflect.TypeOf((*tree.DropDatabase)(nil)): {fn: DropDatabase, on: true, minSupportedClusterVersion: clusterversion.V22_1}, - reflect.TypeOf((*tree.DropOwnedBy)(nil)): {fn: DropOwnedBy, on: true, minSupportedClusterVersion: clusterversion.V22_2Start}, - reflect.TypeOf((*tree.DropSchema)(nil)): {fn: DropSchema, on: true, minSupportedClusterVersion: clusterversion.V22_1}, - reflect.TypeOf((*tree.DropSequence)(nil)): {fn: DropSequence, on: true, minSupportedClusterVersion: clusterversion.V22_1}, - reflect.TypeOf((*tree.DropTable)(nil)): {fn: DropTable, on: true, minSupportedClusterVersion: clusterversion.V22_1}, - reflect.TypeOf((*tree.DropType)(nil)): {fn: DropType, on: true, minSupportedClusterVersion: clusterversion.V22_1}, - reflect.TypeOf((*tree.DropView)(nil)): {fn: DropView, on: true, minSupportedClusterVersion: clusterversion.V22_1}, - reflect.TypeOf((*tree.CommentOnDatabase)(nil)): {fn: CommentOnDatabase, on: true, minSupportedClusterVersion: clusterversion.V22_2Start}, - reflect.TypeOf((*tree.CommentOnSchema)(nil)): {fn: CommentOnSchema, on: true, minSupportedClusterVersion: clusterversion.V22_2Start}, - reflect.TypeOf((*tree.CommentOnTable)(nil)): {fn: CommentOnTable, on: true, minSupportedClusterVersion: clusterversion.V22_2Start}, - reflect.TypeOf((*tree.CommentOnColumn)(nil)): {fn: CommentOnColumn, on: true, minSupportedClusterVersion: clusterversion.V22_2Start}, - reflect.TypeOf((*tree.CommentOnIndex)(nil)): {fn: CommentOnIndex, on: true, minSupportedClusterVersion: clusterversion.V22_2Start}, - reflect.TypeOf((*tree.CommentOnConstraint)(nil)): {fn: CommentOnConstraint, on: true, minSupportedClusterVersion: clusterversion.V22_2Start}, + reflect.TypeOf((*tree.DropDatabase)(nil)): {fn: DropDatabase, on: true, minSupportedClusterVersion: clusterversion.TODODelete_V22_1}, + reflect.TypeOf((*tree.DropOwnedBy)(nil)): {fn: DropOwnedBy, on: true, minSupportedClusterVersion: clusterversion.TODODelete_V22_2Start}, + reflect.TypeOf((*tree.DropSchema)(nil)): {fn: DropSchema, on: true, minSupportedClusterVersion: clusterversion.TODODelete_V22_1}, + reflect.TypeOf((*tree.DropSequence)(nil)): {fn: DropSequence, on: true, minSupportedClusterVersion: clusterversion.TODODelete_V22_1}, + reflect.TypeOf((*tree.DropTable)(nil)): {fn: DropTable, on: true, minSupportedClusterVersion: clusterversion.TODODelete_V22_1}, + reflect.TypeOf((*tree.DropType)(nil)): {fn: DropType, on: true, minSupportedClusterVersion: clusterversion.TODODelete_V22_1}, + reflect.TypeOf((*tree.DropView)(nil)): {fn: DropView, on: true, minSupportedClusterVersion: clusterversion.TODODelete_V22_1}, + reflect.TypeOf((*tree.CommentOnDatabase)(nil)): {fn: CommentOnDatabase, on: true, minSupportedClusterVersion: clusterversion.TODODelete_V22_2Start}, + reflect.TypeOf((*tree.CommentOnSchema)(nil)): {fn: CommentOnSchema, on: true, minSupportedClusterVersion: clusterversion.TODODelete_V22_2Start}, + reflect.TypeOf((*tree.CommentOnTable)(nil)): {fn: CommentOnTable, on: true, minSupportedClusterVersion: clusterversion.TODODelete_V22_2Start}, + reflect.TypeOf((*tree.CommentOnColumn)(nil)): {fn: CommentOnColumn, on: true, minSupportedClusterVersion: clusterversion.TODODelete_V22_2Start}, + reflect.TypeOf((*tree.CommentOnIndex)(nil)): {fn: CommentOnIndex, on: true, minSupportedClusterVersion: clusterversion.TODODelete_V22_2Start}, + reflect.TypeOf((*tree.CommentOnConstraint)(nil)): {fn: CommentOnConstraint, on: true, minSupportedClusterVersion: clusterversion.TODODelete_V22_2Start}, reflect.TypeOf((*tree.DropIndex)(nil)): {fn: DropIndex, on: true, minSupportedClusterVersion: clusterversion.V23_1Start}, reflect.TypeOf((*tree.DropFunction)(nil)): {fn: DropFunction, on: true, minSupportedClusterVersion: clusterversion.V23_1Start}, reflect.TypeOf((*tree.CreateFunction)(nil)): {fn: CreateFunction, on: true, minSupportedClusterVersion: clusterversion.V23_1Start}, diff --git a/pkg/sql/schemachanger/scdeps/exec_deps.go b/pkg/sql/schemachanger/scdeps/exec_deps.go index 4eda2fde1ecc..2e0e7f74e446 100644 --- a/pkg/sql/schemachanger/scdeps/exec_deps.go +++ b/pkg/sql/schemachanger/scdeps/exec_deps.go @@ -253,7 +253,7 @@ func (d *txnDeps) CheckPausepoint(name string) error { } func (d *txnDeps) UseLegacyGCJob(ctx context.Context) bool { - return !d.settings.Version.IsActive(ctx, clusterversion.V22_2UseDelRangeInGCJob) + return !d.settings.Version.IsActive(ctx, clusterversion.TODODelete_V22_2UseDelRangeInGCJob) } func (d *txnDeps) SchemaChangerJobID() jobspb.JobID { diff --git a/pkg/sql/schemachanger/screl/scalars.go b/pkg/sql/schemachanger/screl/scalars.go index 95330515b9de..de54ef85374c 100644 --- a/pkg/sql/schemachanger/screl/scalars.go +++ b/pkg/sql/schemachanger/screl/scalars.go @@ -115,11 +115,11 @@ func MinVersion(el scpb.Element) clusterversion.Key { *scpb.Namespace, *scpb.Owner, *scpb.UserPrivileges, *scpb.DatabaseRegionConfig, *scpb.DatabaseRoleSetting, *scpb.DatabaseComment, *scpb.SchemaParent, *scpb.SchemaComment, *scpb.ObjectParent: - return clusterversion.V22_1 + return clusterversion.TODODelete_V22_1 case *scpb.CompositeType, *scpb.CompositeTypeAttrType, *scpb.CompositeTypeAttrName: return clusterversion.V23_1 case *scpb.IndexColumn, *scpb.EnumTypeValue, *scpb.TableZoneConfig: - return clusterversion.V22_2UseDelRangeInGCJob + return clusterversion.TODODelete_V22_2UseDelRangeInGCJob case *scpb.DatabaseData, *scpb.TableData, *scpb.IndexData, *scpb.TablePartitioning, *scpb.Function, *scpb.FunctionName, *scpb.FunctionVolatility, *scpb.FunctionLeakProof, *scpb.FunctionNullInputBehavior, *scpb.FunctionBody, *scpb.FunctionParamDefaultExpression: diff --git a/pkg/sql/sqlstats/persistedsqlstats/flush.go b/pkg/sql/sqlstats/persistedsqlstats/flush.go index 1ae5fff82e3e..2d651807936e 100644 --- a/pkg/sql/sqlstats/persistedsqlstats/flush.go +++ b/pkg/sql/sqlstats/persistedsqlstats/flush.go @@ -500,7 +500,7 @@ func (s *PersistedSQLStats) insertStatementStats( statistics, // statistics plan, // plan ) - if s.cfg.Settings.Version.IsActive(ctx, clusterversion.V22_2AlterSystemStatementStatisticsAddIndexRecommendations) { + if s.cfg.Settings.Version.IsActive(ctx, clusterversion.TODODelete_V22_2AlterSystemStatementStatisticsAddIndexRecommendations) { values = values + ", $11" indexRecommendations := tree.NewDArray(types.String) for _, recommendation := range stats.Stats.IndexRecommendations { diff --git a/pkg/sql/sqlstats/persistedsqlstats/stmt_reader.go b/pkg/sql/sqlstats/persistedsqlstats/stmt_reader.go index 84b6b7b27e37..796259e5f3f3 100644 --- a/pkg/sql/sqlstats/persistedsqlstats/stmt_reader.go +++ b/pkg/sql/sqlstats/persistedsqlstats/stmt_reader.go @@ -114,7 +114,7 @@ func (s *PersistedSQLStats) getFetchQueryForStmtStatsTable( "agg_interval", } - if s.cfg.Settings.Version.IsActive(ctx, clusterversion.V22_2AlterSystemStatementStatisticsAddIndexRecommendations) { + if s.cfg.Settings.Version.IsActive(ctx, clusterversion.TODODelete_V22_2AlterSystemStatementStatisticsAddIndexRecommendations) { selectedColumns = append(selectedColumns, "index_recommendations") } diff --git a/pkg/sql/stmtdiagnostics/statement_diagnostics.go b/pkg/sql/stmtdiagnostics/statement_diagnostics.go index 38eedcfdbb3c..acb28873d26f 100644 --- a/pkg/sql/stmtdiagnostics/statement_diagnostics.go +++ b/pkg/sql/stmtdiagnostics/statement_diagnostics.go @@ -282,7 +282,7 @@ func (r *Registry) insertRequestInternal( minExecutionLatency time.Duration, expiresAfter time.Duration, ) (RequestID, error) { - isSamplingProbabilitySupported := r.st.Version.IsActive(ctx, clusterversion.V22_2SampledStmtDiagReqs) + isSamplingProbabilitySupported := r.st.Version.IsActive(ctx, clusterversion.TODODelete_V22_2SampledStmtDiagReqs) if !isSamplingProbabilitySupported && samplingProbability != 0 { return 0, errors.New( "sampling probability only supported after 22.2 version migrations have completed", @@ -647,7 +647,7 @@ func (r *Registry) InsertStatementDiagnostics( // updates r.mu.requests accordingly. func (r *Registry) pollRequests(ctx context.Context) error { var rows []tree.Datums - isSamplingProbabilitySupported := r.st.Version.IsActive(ctx, clusterversion.V22_2SampledStmtDiagReqs) + isSamplingProbabilitySupported := r.st.Version.IsActive(ctx, clusterversion.TODODelete_V22_2SampledStmtDiagReqs) // Loop until we run the query without straddling an epoch increment. for { diff --git a/pkg/sql/syntheticprivilegecache/cache.go b/pkg/sql/syntheticprivilegecache/cache.go index 4c131f876af7..7f95736d2c28 100644 --- a/pkg/sql/syntheticprivilegecache/cache.go +++ b/pkg/sql/syntheticprivilegecache/cache.go @@ -188,7 +188,7 @@ func (c *Cache) readFromStorage( func (c *Cache) Start(ctx context.Context) { if err := c.stopper.RunAsyncTask(ctx, "syntheticprivilegecache-warm", func(ctx context.Context) { defer close(c.warmed) - if !c.settings.Version.IsActive(ctx, clusterversion.V22_2SystemPrivilegesTable) { + if !c.settings.Version.IsActive(ctx, clusterversion.TODODelete_V22_2SystemPrivilegesTable) { return } start := timeutil.Now() diff --git a/pkg/sql/truncate.go b/pkg/sql/truncate.go index 3eccbf0ea1bb..1b367458b95e 100644 --- a/pkg/sql/truncate.go +++ b/pkg/sql/truncate.go @@ -257,7 +257,7 @@ func (p *planner) truncateTable(ctx context.Context, id descpb.ID, jobDesc strin record := CreateGCJobRecord( jobDesc, p.User(), details, !p.execCfg.Settings.Version.IsActive( - ctx, clusterversion.V22_2UseDelRangeInGCJob, + ctx, clusterversion.TODODelete_V22_2UseDelRangeInGCJob, ), ) if _, err := p.ExecCfg().JobRegistry.CreateAdoptableJobWithTxn( diff --git a/pkg/storage/engine_test.go b/pkg/storage/engine_test.go index 14ef62c9f0d0..f397ef5f7d31 100644 --- a/pkg/storage/engine_test.go +++ b/pkg/storage/engine_test.go @@ -2041,7 +2041,7 @@ func TestEngineRangeKeysUnsupported(t *testing.T) { defer log.Scope(t).Close(t) // Set up an engine with a version that doesn't support range keys. - version := clusterversion.ByKey(clusterversion.V22_2EnsurePebbleFormatVersionRangeKeys - 1) + version := clusterversion.ByKey(clusterversion.TODODelete_V22_2EnsurePebbleFormatVersionRangeKeys - 1) st := cluster.MakeTestingClusterSettingsWithVersions(version, version, true) eng, err := Open(context.Background(), InMemory(), st, MaxSize(1<<20)) diff --git a/pkg/storage/mvcc.go b/pkg/storage/mvcc.go index dd41d22970c5..91e5c56c783d 100644 --- a/pkg/storage/mvcc.go +++ b/pkg/storage/mvcc.go @@ -94,7 +94,7 @@ var MVCCRangeTombstonesEnabled = settings.RegisterBoolSetting( // It requires the MVCCRangeTombstones version gate to be active, and the // setting storage.mvcc.range_tombstones.enabled to be enabled. func CanUseMVCCRangeTombstones(ctx context.Context, st *cluster.Settings) bool { - return st.Version.IsActive(ctx, clusterversion.V22_2MVCCRangeTombstones) && + return st.Version.IsActive(ctx, clusterversion.TODODelete_V22_2MVCCRangeTombstones) && MVCCRangeTombstonesEnabled.Get(&st.SV) } diff --git a/pkg/storage/pebble.go b/pkg/storage/pebble.go index 1240cf7a545f..3bc1b5fc53d0 100644 --- a/pkg/storage/pebble.go +++ b/pkg/storage/pebble.go @@ -1520,7 +1520,7 @@ func shouldWriteLocalTimestamps(ctx context.Context, settings *cluster.Settings) // is safe to write local timestamps. return true } - return ver.IsActive(clusterversion.V22_2LocalTimestamps) + return ver.IsActive(clusterversion.TODODelete_V22_2LocalTimestamps) } // ShouldWriteLocalTimestamps implements the Writer interface. @@ -1970,17 +1970,17 @@ func (p *Pebble) SetMinVersion(version roachpb.Version) error { case !version.Less(clusterversion.ByKey(clusterversion.V23_1EnsurePebbleFormatSSTableValueBlocks)): formatVers = pebble.FormatSSTableValueBlocks - case !version.Less(clusterversion.ByKey(clusterversion.V22_2PebbleFormatPrePebblev1Marked)): + case !version.Less(clusterversion.ByKey(clusterversion.TODODelete_V22_2PebbleFormatPrePebblev1Marked)): formatVers = pebble.FormatPrePebblev1Marked - case !version.Less(clusterversion.ByKey(clusterversion.V22_2EnsurePebbleFormatVersionRangeKeys)): + case !version.Less(clusterversion.ByKey(clusterversion.TODODelete_V22_2EnsurePebbleFormatVersionRangeKeys)): formatVers = pebble.FormatRangeKeys - case !version.Less(clusterversion.ByKey(clusterversion.V22_2PebbleFormatSplitUserKeysMarkedCompacted)): + case !version.Less(clusterversion.ByKey(clusterversion.TODODelete_V22_2PebbleFormatSplitUserKeysMarkedCompacted)): formatVers = pebble.FormatSplitUserKeysMarkedCompacted default: - // Corresponds to V22_1. + // Corresponds to TODODelete_V22_1. formatVers = pebble.FormatSplitUserKeysMarked } diff --git a/pkg/storage/pebble_iterator_test.go b/pkg/storage/pebble_iterator_test.go index 7628ed93ef5e..21ecad9cf98c 100644 --- a/pkg/storage/pebble_iterator_test.go +++ b/pkg/storage/pebble_iterator_test.go @@ -94,7 +94,7 @@ func randStr(fill []byte, rng *rand.Rand) { func TestPebbleIterator_ExternalCorruption(t *testing.T) { defer leaktest.AfterTest(t)() - version := clusterversion.ByKey(clusterversion.V22_2EnsurePebbleFormatVersionRangeKeys) + version := clusterversion.ByKey(clusterversion.TODODelete_V22_2EnsurePebbleFormatVersionRangeKeys) st := cluster.MakeTestingClusterSettingsWithVersions(version, version, true) ctx := context.Background() rng := rand.New(rand.NewSource(timeutil.Now().UnixNano())) diff --git a/pkg/storage/sst_writer.go b/pkg/storage/sst_writer.go index 7ca4f910c1f6..20ccf11985ef 100644 --- a/pkg/storage/sst_writer.go +++ b/pkg/storage/sst_writer.go @@ -63,7 +63,7 @@ func MakeIngestionWriterOptions(ctx context.Context, cs *cluster.Settings) sstab // table features available. Upgrade to an appropriate version only if the // cluster supports it. format := sstable.TableFormatPebblev1 // Block properties. - if cs.Version.IsActive(ctx, clusterversion.V22_2EnablePebbleFormatVersionRangeKeys) { + if cs.Version.IsActive(ctx, clusterversion.TODODelete_V22_2EnablePebbleFormatVersionRangeKeys) { format = sstable.TableFormatPebblev2 // Range keys. } if cs.Version.IsActive(ctx, clusterversion.V23_1EnablePebbleFormatSSTableValueBlocks) && @@ -82,7 +82,7 @@ func MakeBackupSSTWriter(ctx context.Context, cs *cluster.Settings, f io.Writer) // table features available. Upgrade to an appropriate version only if the // cluster supports it. format := sstable.TableFormatPebblev1 // Block properties. - if cs.Version.IsActive(ctx, clusterversion.V22_2EnablePebbleFormatVersionRangeKeys) { + if cs.Version.IsActive(ctx, clusterversion.TODODelete_V22_2EnablePebbleFormatVersionRangeKeys) { format = sstable.TableFormatPebblev2 // Range keys. } // TODO(sumeer): add code to use TableFormatPebblev3 after confirming that diff --git a/pkg/storage/sst_writer_test.go b/pkg/storage/sst_writer_test.go index c0024d7b8359..af2a94db22c4 100644 --- a/pkg/storage/sst_writer_test.go +++ b/pkg/storage/sst_writer_test.go @@ -89,7 +89,7 @@ func TestMakeIngestionWriterOptions(t *testing.T) { { name: "before feature gate", st: cluster.MakeTestingClusterSettingsWithVersions( - clusterversion.ByKey(clusterversion.V22_2EnablePebbleFormatVersionRangeKeys-1), + clusterversion.ByKey(clusterversion.TODODelete_V22_2EnablePebbleFormatVersionRangeKeys-1), clusterversion.TestingBinaryMinSupportedVersion, true, ), @@ -98,7 +98,7 @@ func TestMakeIngestionWriterOptions(t *testing.T) { { name: "at feature gate", st: cluster.MakeTestingClusterSettingsWithVersions( - clusterversion.ByKey(clusterversion.V22_2EnablePebbleFormatVersionRangeKeys), + clusterversion.ByKey(clusterversion.TODODelete_V22_2EnablePebbleFormatVersionRangeKeys), clusterversion.TestingBinaryMinSupportedVersion, true, ), @@ -122,7 +122,7 @@ func TestSSTWriterRangeKeysUnsupported(t *testing.T) { ctx := context.Background() // Set up a version that doesn't support range keys. - version := clusterversion.ByKey(clusterversion.V22_2EnsurePebbleFormatVersionRangeKeys - 1) + version := clusterversion.ByKey(clusterversion.TODODelete_V22_2EnsurePebbleFormatVersionRangeKeys - 1) st := cluster.MakeTestingClusterSettingsWithVersions(version, version, true) writers := map[string]SSTWriter{ diff --git a/pkg/upgrade/upgrademanager/manager_external_test.go b/pkg/upgrade/upgrademanager/manager_external_test.go index 587d9050d5f1..64b6bd6a7cd3 100644 --- a/pkg/upgrade/upgrademanager/manager_external_test.go +++ b/pkg/upgrade/upgrademanager/manager_external_test.go @@ -512,7 +512,7 @@ func TestPrecondition(t *testing.T) { version.Internal += 2 return version } - v0 := clusterversion.ByKey(clusterversion.V22_1) + v0 := clusterversion.ByKey(clusterversion.TODODelete_V22_1) v1 := next(v0) v2 := next(v1) versions := []roachpb.Version{v0, v1, v2} diff --git a/pkg/upgrade/upgrades/alter_sql_instances_locality_test.go b/pkg/upgrade/upgrades/alter_sql_instances_locality_test.go index 375a46774745..e1094d5bcf5d 100644 --- a/pkg/upgrade/upgrades/alter_sql_instances_locality_test.go +++ b/pkg/upgrade/upgrades/alter_sql_instances_locality_test.go @@ -45,7 +45,7 @@ func TestAlterSystemSqlInstancesTable(t *testing.T) { Server: &server.TestingKnobs{ DisableAutomaticVersionUpgrade: make(chan struct{}), BinaryVersionOverride: clusterversion.ByKey( - clusterversion.V22_2AlterSystemSQLInstancesAddLocality - 1), + clusterversion.TODODelete_V22_2AlterSystemSQLInstancesAddLocality - 1), }, }, }, @@ -85,7 +85,7 @@ func TestAlterSystemSqlInstancesTable(t *testing.T) { upgrades.Upgrade( t, sqlDB, - clusterversion.V22_2AlterSystemSQLInstancesAddLocality, + clusterversion.TODODelete_V22_2AlterSystemSQLInstancesAddLocality, nil, /* done */ false, /* expectError */ ) diff --git a/pkg/upgrade/upgrades/alter_statement_statistics_index_recommendations_test.go b/pkg/upgrade/upgrades/alter_statement_statistics_index_recommendations_test.go index a8200c20266a..e76a3ef28b48 100644 --- a/pkg/upgrade/upgrades/alter_statement_statistics_index_recommendations_test.go +++ b/pkg/upgrade/upgrades/alter_statement_statistics_index_recommendations_test.go @@ -46,7 +46,7 @@ func TestAlterSystemStatementStatisticsTable(t *testing.T) { Server: &server.TestingKnobs{ DisableAutomaticVersionUpgrade: make(chan struct{}), BinaryVersionOverride: clusterversion.ByKey( - clusterversion.V22_2AlterSystemStatementStatisticsAddIndexRecommendations - 1), + clusterversion.TODODelete_V22_2AlterSystemStatementStatisticsAddIndexRecommendations - 1), }, }, }, @@ -86,7 +86,7 @@ func TestAlterSystemStatementStatisticsTable(t *testing.T) { upgrades.Upgrade( t, sqlDB, - clusterversion.V22_2AlterSystemStatementStatisticsAddIndexRecommendations, + clusterversion.TODODelete_V22_2AlterSystemStatementStatisticsAddIndexRecommendations, nil, /* done */ false, /* expectError */ ) diff --git a/pkg/upgrade/upgrades/builtins_test.go b/pkg/upgrade/upgrades/builtins_test.go index 4d4cb4a0f097..7b11f2edb338 100644 --- a/pkg/upgrade/upgrades/builtins_test.go +++ b/pkg/upgrade/upgrades/builtins_test.go @@ -35,7 +35,7 @@ func TestIsAtLeastVersionBuiltin(t *testing.T) { Knobs: base.TestingKnobs{ Server: &server.TestingKnobs{ DisableAutomaticVersionUpgrade: make(chan struct{}), - BinaryVersionOverride: clusterversion.ByKey(clusterversion.V22_1), + BinaryVersionOverride: clusterversion.ByKey(clusterversion.TODODelete_V22_1), }, }, }, @@ -49,7 +49,7 @@ func TestIsAtLeastVersionBuiltin(t *testing.T) { ) defer tc.Stopper().Stop(ctx) - v := clusterversion.ByKey(clusterversion.V22_2Start).String() + v := clusterversion.ByKey(clusterversion.TODODelete_V22_2Start).String() // Check that the builtin returns false when comparing against 22.1-2 // version because we are still on 22.1-0. sqlDB.CheckQueryResults(t, "SELECT crdb_internal.is_at_least_version('"+v+"')", [][]string{{"false"}}) diff --git a/pkg/upgrade/upgrades/ensure_sql_schema_telemetry_schedule_test.go b/pkg/upgrade/upgrades/ensure_sql_schema_telemetry_schedule_test.go index ebbca976690a..a964142d67c3 100644 --- a/pkg/upgrade/upgrades/ensure_sql_schema_telemetry_schedule_test.go +++ b/pkg/upgrade/upgrades/ensure_sql_schema_telemetry_schedule_test.go @@ -77,7 +77,7 @@ func TestSchemaTelemetrySchedule(t *testing.T) { } args.Knobs.Server = &server.TestingKnobs{ DisableAutomaticVersionUpgrade: make(chan struct{}), - BinaryVersionOverride: clusterversion.ByKey(clusterversion.V22_2SQLSchemaTelemetryScheduledJobs - 1), + BinaryVersionOverride: clusterversion.ByKey(clusterversion.TODODelete_V22_2SQLSchemaTelemetryScheduledJobs - 1), } tc := testcluster.StartTestCluster(t, 1, base.TestClusterArgs{ServerArgs: args}) defer tc.Stopper().Stop(ctx) @@ -100,7 +100,7 @@ func TestSchemaTelemetrySchedule(t *testing.T) { // Upgrade the cluster. tdb.Exec(t, `SET CLUSTER SETTING version = $1`, - clusterversion.ByKey(clusterversion.V22_2SQLSchemaTelemetryScheduledJobs).String()) + clusterversion.ByKey(clusterversion.TODODelete_V22_2SQLSchemaTelemetryScheduledJobs).String()) // Check that the schedule now exists and that jobs can be created. tdb.Exec(t, qJob) diff --git a/pkg/upgrade/upgrades/fix_userfile_descriptor_corruption_test.go b/pkg/upgrade/upgrades/fix_userfile_descriptor_corruption_test.go index f381ea2f8309..49b70f690055 100644 --- a/pkg/upgrade/upgrades/fix_userfile_descriptor_corruption_test.go +++ b/pkg/upgrade/upgrades/fix_userfile_descriptor_corruption_test.go @@ -65,8 +65,8 @@ func TestFixUserfileRelatedDescriptorCorruptionUpgrade(t *testing.T) { defer log.Scope(t).Close(t) var ( - v0 = clusterversion.ByKey(clusterversion.V22_2FixUserfileRelatedDescriptorCorruption - 1) - v1 = clusterversion.ByKey(clusterversion.V22_2FixUserfileRelatedDescriptorCorruption) + v0 = clusterversion.ByKey(clusterversion.TODODelete_V22_2FixUserfileRelatedDescriptorCorruption - 1) + v1 = clusterversion.ByKey(clusterversion.TODODelete_V22_2FixUserfileRelatedDescriptorCorruption) ) ctx := context.Background() diff --git a/pkg/upgrade/upgrades/precondition_before_starting_an_upgrade_external_test.go b/pkg/upgrade/upgrades/precondition_before_starting_an_upgrade_external_test.go index 80ecb46fab9f..82712b25b1d0 100644 --- a/pkg/upgrade/upgrades/precondition_before_starting_an_upgrade_external_test.go +++ b/pkg/upgrade/upgrades/precondition_before_starting_an_upgrade_external_test.go @@ -40,8 +40,8 @@ func TestPreconditionBeforeStartingAnUpgrade(t *testing.T) { defer log.Scope(t).Close(t) var ( - v0 = clusterversion.ByKey(clusterversion.V22_2Start - 1) - v1 = clusterversion.ByKey(clusterversion.V22_2Start) + v0 = clusterversion.ByKey(clusterversion.TODODelete_V22_2Start - 1) + v1 = clusterversion.ByKey(clusterversion.TODODelete_V22_2Start) ) ctx := context.Background() diff --git a/pkg/upgrade/upgrades/role_options_migration_test.go b/pkg/upgrade/upgrades/role_options_migration_test.go index e08dd12bea5a..82dd96293ebc 100644 --- a/pkg/upgrade/upgrades/role_options_migration_test.go +++ b/pkg/upgrade/upgrades/role_options_migration_test.go @@ -44,7 +44,7 @@ func runTestRoleOptionsMigration(t *testing.T, numUsers int) { settings := cluster.MakeTestingClusterSettingsWithVersions( clusterversion.TestingBinaryVersion, - clusterversion.ByKey(clusterversion.V22_2RoleOptionsTableHasIDColumn-1), + clusterversion.ByKey(clusterversion.TODODelete_V22_2RoleOptionsTableHasIDColumn-1), false, ) @@ -54,7 +54,7 @@ func runTestRoleOptionsMigration(t *testing.T, numUsers int) { Knobs: base.TestingKnobs{ Server: &server.TestingKnobs{ DisableAutomaticVersionUpgrade: make(chan struct{}), - BinaryVersionOverride: clusterversion.ByKey(clusterversion.V22_2RoleOptionsTableHasIDColumn - 1), + BinaryVersionOverride: clusterversion.ByKey(clusterversion.TODODelete_V22_2RoleOptionsTableHasIDColumn - 1), }, }, }, @@ -167,15 +167,15 @@ func runTestRoleOptionsMigration(t *testing.T, numUsers int) { }) _, err := tc.Conns[0].ExecContext(ctx, `SET CLUSTER SETTING version = $1`, - clusterversion.ByKey(clusterversion.V22_2RoleOptionsTableHasIDColumn).String()) + clusterversion.ByKey(clusterversion.TODODelete_V22_2RoleOptionsTableHasIDColumn).String()) require.NoError(t, err) _, err = tc.Conns[0].ExecContext(ctx, `SET CLUSTER SETTING version = $1`, - clusterversion.ByKey(clusterversion.V22_2RoleOptionsIDColumnIsBackfilled).String()) + clusterversion.ByKey(clusterversion.TODODelete_V22_2RoleOptionsIDColumnIsBackfilled).String()) require.NoError(t, err) _, err = tc.Conns[0].ExecContext(ctx, `SET CLUSTER SETTING version = $1`, - clusterversion.ByKey(clusterversion.V22_2SetRoleOptionsUserIDColumnNotNull).String()) + clusterversion.ByKey(clusterversion.TODODelete_V22_2SetRoleOptionsUserIDColumnNotNull).String()) require.NoError(t, err) tdb.CheckQueryResults(t, `SELECT * FROM system.role_options WHERE username = 'testuser' or username = 'testuser_last'`, [][]string{ diff --git a/pkg/upgrade/upgrades/sampled_stmt_diagnostics_requests_test.go b/pkg/upgrade/upgrades/sampled_stmt_diagnostics_requests_test.go index 631873aff50b..d4438e55cd77 100644 --- a/pkg/upgrade/upgrades/sampled_stmt_diagnostics_requests_test.go +++ b/pkg/upgrade/upgrades/sampled_stmt_diagnostics_requests_test.go @@ -44,7 +44,7 @@ func TestSampledStmtDiagReqsMigration(t *testing.T) { Knobs: base.TestingKnobs{ Server: &server.TestingKnobs{ DisableAutomaticVersionUpgrade: make(chan struct{}), - BinaryVersionOverride: clusterversion.ByKey(clusterversion.V22_2SampledStmtDiagReqs - 1), + BinaryVersionOverride: clusterversion.ByKey(clusterversion.TODODelete_V22_2SampledStmtDiagReqs - 1), }, }, }, @@ -93,7 +93,7 @@ func TestSampledStmtDiagReqsMigration(t *testing.T) { upgrades.Upgrade( t, sqlDB, - clusterversion.V22_2SampledStmtDiagReqs, + clusterversion.TODODelete_V22_2SampledStmtDiagReqs, nil, /* done */ false, /* expectError */ ) diff --git a/pkg/upgrade/upgrades/update_invalid_column_ids_in_sequence_back_references_external_test.go b/pkg/upgrade/upgrades/update_invalid_column_ids_in_sequence_back_references_external_test.go index 04b5990dc703..ca7f2a6494d9 100644 --- a/pkg/upgrade/upgrades/update_invalid_column_ids_in_sequence_back_references_external_test.go +++ b/pkg/upgrade/upgrades/update_invalid_column_ids_in_sequence_back_references_external_test.go @@ -39,8 +39,8 @@ func TestUpdateInvalidColumnIDsInSequenceBackReferences(t *testing.T) { defer log.Scope(t).Close(t) var ( - v0 = clusterversion.ByKey(clusterversion.V22_2UpdateInvalidColumnIDsInSequenceBackReferences - 1) - v1 = clusterversion.ByKey(clusterversion.V22_2UpdateInvalidColumnIDsInSequenceBackReferences) + v0 = clusterversion.ByKey(clusterversion.TODODelete_V22_2UpdateInvalidColumnIDsInSequenceBackReferences - 1) + v1 = clusterversion.ByKey(clusterversion.TODODelete_V22_2UpdateInvalidColumnIDsInSequenceBackReferences) ) type TestCase struct { diff --git a/pkg/upgrade/upgrades/upgrade_sequence_to_be_referenced_by_ID_external_test.go b/pkg/upgrade/upgrades/upgrade_sequence_to_be_referenced_by_ID_external_test.go index e37850c6ede1..4610fe2af2db 100644 --- a/pkg/upgrade/upgrades/upgrade_sequence_to_be_referenced_by_ID_external_test.go +++ b/pkg/upgrade/upgrades/upgrade_sequence_to_be_referenced_by_ID_external_test.go @@ -39,8 +39,8 @@ func TestUpgradeSeqToBeReferencedByID(t *testing.T) { defer log.Scope(t).Close(t) var ( - v0 = clusterversion.ByKey(clusterversion.V22_2UpgradeSequenceToBeReferencedByID - 1) - v1 = clusterversion.ByKey(clusterversion.V22_2UpgradeSequenceToBeReferencedByID) + v0 = clusterversion.ByKey(clusterversion.TODODelete_V22_2UpgradeSequenceToBeReferencedByID - 1) + v1 = clusterversion.ByKey(clusterversion.TODODelete_V22_2UpgradeSequenceToBeReferencedByID) ) ctx := context.Background() diff --git a/pkg/upgrade/upgrades/upgrades.go b/pkg/upgrade/upgrades/upgrades.go index 4d5e8a273e5e..af59aaa64f77 100644 --- a/pkg/upgrade/upgrades/upgrades.go +++ b/pkg/upgrade/upgrades/upgrades.go @@ -95,42 +95,42 @@ var upgrades = []upgradebase.Upgrade{ ), upgrade.NewTenantUpgrade( "ensure preconditions are met before starting upgrading to v22.2", - toCV(clusterversion.V22_2Start), + toCV(clusterversion.TODODelete_V22_2Start), preconditionBeforeStartingAnUpgrade, NoTenantUpgradeFunc, ), upgrade.NewTenantUpgrade( "upgrade sequences to be referenced by ID", - toCV(clusterversion.V22_2UpgradeSequenceToBeReferencedByID), + toCV(clusterversion.TODODelete_V22_2UpgradeSequenceToBeReferencedByID), upgrade.NoPrecondition, upgradeSequenceToBeReferencedByID, ), upgrade.NewTenantUpgrade( "update system.statement_diagnostics_requests to support sampling probabilities", - toCV(clusterversion.V22_2SampledStmtDiagReqs), + toCV(clusterversion.TODODelete_V22_2SampledStmtDiagReqs), upgrade.NoPrecondition, sampledStmtDiagReqsMigration, ), upgrade.NewTenantUpgrade( "add column locality to table system.sql_instances", - toCV(clusterversion.V22_2AlterSystemSQLInstancesAddLocality), + toCV(clusterversion.TODODelete_V22_2AlterSystemSQLInstancesAddLocality), upgrade.NoPrecondition, alterSystemSQLInstancesAddLocality, ), upgrade.NewTenantUpgrade( "add the system.external_connections table", - toCV(clusterversion.V22_2SystemExternalConnectionsTable), + toCV(clusterversion.TODODelete_V22_2SystemExternalConnectionsTable), upgrade.NoPrecondition, systemExternalConnectionsTableMigration, ), upgrade.NewTenantUpgrade( "add column index_recommendations to table system.statement_statistics", - toCV(clusterversion.V22_2AlterSystemStatementStatisticsAddIndexRecommendations), + toCV(clusterversion.TODODelete_V22_2AlterSystemStatementStatisticsAddIndexRecommendations), upgrade.NoPrecondition, alterSystemStatementStatisticsAddIndexRecommendations, ), upgrade.NewTenantUpgrade("add system.role_id_sequence", - toCV(clusterversion.V22_2RoleIDSequence), + toCV(clusterversion.TODODelete_V22_2RoleIDSequence), upgrade.NoPrecondition, roleIDSequenceMigration, ), @@ -141,59 +141,59 @@ var upgrades = []upgradebase.Upgrade{ // off point where we know which users need to be backfilled and no // more users can be created without ids. upgrade.NewTenantUpgrade("alter system.users to include user_id column", - toCV(clusterversion.V22_2AddSystemUserIDColumn), + toCV(clusterversion.TODODelete_V22_2AddSystemUserIDColumn), upgrade.NoPrecondition, alterSystemUsersAddUserIDColumnWithIndex, ), upgrade.NewTenantUpgrade("backfill users with ids and add an index on the id column", - toCV(clusterversion.V22_2SystemUsersIDColumnIsBackfilled), + toCV(clusterversion.TODODelete_V22_2SystemUsersIDColumnIsBackfilled), upgrade.NoPrecondition, backfillSystemUsersIDColumn, ), upgrade.NewTenantUpgrade("set user_id column to not null", - toCV(clusterversion.V22_2SetSystemUsersUserIDColumnNotNull), + toCV(clusterversion.TODODelete_V22_2SetSystemUsersUserIDColumnNotNull), upgrade.NoPrecondition, setUserIDNotNull, ), upgrade.NewTenantUpgrade( "add default SQL schema telemetry schedule", - toCV(clusterversion.V22_2SQLSchemaTelemetryScheduledJobs), + toCV(clusterversion.TODODelete_V22_2SQLSchemaTelemetryScheduledJobs), upgrade.NoPrecondition, ensureSQLSchemaTelemetrySchedule, ), upgrade.NewTenantUpgrade("alter system.role_options to include user_id column", - toCV(clusterversion.V22_2RoleOptionsTableHasIDColumn), + toCV(clusterversion.TODODelete_V22_2RoleOptionsTableHasIDColumn), upgrade.NoPrecondition, alterSystemRoleOptionsAddUserIDColumnWithIndex, ), upgrade.NewTenantUpgrade("backfill entries in system.role_options to include IDs", - toCV(clusterversion.V22_2RoleOptionsIDColumnIsBackfilled), + toCV(clusterversion.TODODelete_V22_2RoleOptionsIDColumnIsBackfilled), upgrade.NoPrecondition, backfillSystemRoleOptionsIDColumn, ), upgrade.NewTenantUpgrade("set system.role_options user_id column to not null", - toCV(clusterversion.V22_2SetRoleOptionsUserIDColumnNotNull), + toCV(clusterversion.TODODelete_V22_2SetRoleOptionsUserIDColumnNotNull), upgrade.NoPrecondition, setSystemRoleOptionsUserIDColumnNotNull, ), upgrade.NewTenantUpgrade("ensure all GC jobs send DeleteRange requests", - toCV(clusterversion.V22_2WaitedForDelRangeInGCJob), + toCV(clusterversion.TODODelete_V22_2WaitedForDelRangeInGCJob), checkForPausedGCJobs, waitForDelRangeInGCJob, ), upgrade.NewTenantUpgrade( "wait for all in-flight schema changes", - toCV(clusterversion.V22_2NoNonMVCCAddSSTable), + toCV(clusterversion.TODODelete_V22_2NoNonMVCCAddSSTable), upgrade.NoPrecondition, waitForAllSchemaChanges, ), upgrade.NewTenantUpgrade("update invalid column IDs in sequence back references", - toCV(clusterversion.V22_2UpdateInvalidColumnIDsInSequenceBackReferences), + toCV(clusterversion.TODODelete_V22_2UpdateInvalidColumnIDsInSequenceBackReferences), upgrade.NoPrecondition, updateInvalidColumnIDsInSequenceBackReferences, ), upgrade.NewTenantUpgrade("fix corrupt user-file related table descriptors", - toCV(clusterversion.V22_2FixUserfileRelatedDescriptorCorruption), + toCV(clusterversion.TODODelete_V22_2FixUserfileRelatedDescriptorCorruption), upgrade.NoPrecondition, fixInvalidObjectsThatLookLikeBadUserfileConstraint, ), diff --git a/pkg/upgrade/upgrades/wait_for_del_range_in_gc_job_test.go b/pkg/upgrade/upgrades/wait_for_del_range_in_gc_job_test.go index 1e699dd6b2db..00fd9e7a584a 100644 --- a/pkg/upgrade/upgrades/wait_for_del_range_in_gc_job_test.go +++ b/pkg/upgrade/upgrades/wait_for_del_range_in_gc_job_test.go @@ -33,8 +33,8 @@ func TestWaitForDelRangeInGCJob(t *testing.T) { defer log.Scope(t).Close(t) var ( - v0 = clusterversion.ByKey(clusterversion.V22_2UseDelRangeInGCJob - 1) - v1 = clusterversion.ByKey(clusterversion.V22_2WaitedForDelRangeInGCJob) + v0 = clusterversion.ByKey(clusterversion.TODODelete_V22_2UseDelRangeInGCJob - 1) + v1 = clusterversion.ByKey(clusterversion.TODODelete_V22_2WaitedForDelRangeInGCJob) ) ctx := context.Background() diff --git a/pkg/upgrade/upgrades/wait_for_schema_changes_test.go b/pkg/upgrade/upgrades/wait_for_schema_changes_test.go index e49f62ff3e3f..e62c900679cc 100644 --- a/pkg/upgrade/upgrades/wait_for_schema_changes_test.go +++ b/pkg/upgrade/upgrades/wait_for_schema_changes_test.go @@ -125,7 +125,7 @@ func TestWaitForSchemaChangeMigration(t *testing.T) { params, _ := tests.CreateTestServerParams() params.Knobs.Server = &server.TestingKnobs{ DisableAutomaticVersionUpgrade: make(chan struct{}), - BinaryVersionOverride: clusterversion.ByKey(clusterversion.V22_2NoNonMVCCAddSSTable - 1), + BinaryVersionOverride: clusterversion.ByKey(clusterversion.TODODelete_V22_2NoNonMVCCAddSSTable - 1), } var ( @@ -253,7 +253,7 @@ func TestWaitForSchemaChangeMigrationSynthetic(t *testing.T) { params, _ := tests.CreateTestServerParams() params.Knobs.Server = &server.TestingKnobs{ DisableAutomaticVersionUpgrade: make(chan struct{}), - BinaryVersionOverride: clusterversion.ByKey(clusterversion.V22_2NoNonMVCCAddSSTable - 1), + BinaryVersionOverride: clusterversion.ByKey(clusterversion.TODODelete_V22_2NoNonMVCCAddSSTable - 1), } var waitCount int32 diff --git a/pkg/workload/schemachange/operation_generator.go b/pkg/workload/schemachange/operation_generator.go index e758bde73e01..20f6a5035eae 100644 --- a/pkg/workload/schemachange/operation_generator.go +++ b/pkg/workload/schemachange/operation_generator.go @@ -957,7 +957,7 @@ func (og *operationGenerator) createIndex(ctx context.Context, tx pgx.Tx) (*opSt invisibleIndexesIsNotSupported, err := isClusterVersionLessThan( ctx, tx, - clusterversion.ByKey(clusterversion.V22_2Start)) + clusterversion.ByKey(clusterversion.TODODelete_V22_2Start)) if err != nil { return nil, err } @@ -1214,7 +1214,7 @@ func (og *operationGenerator) createTable(ctx context.Context, tx pgx.Tx) (*opSt trigramIsNotSupported, err := isClusterVersionLessThan( ctx, tx, - clusterversion.ByKey(clusterversion.V22_2TrigramInvertedIndexes)) + clusterversion.ByKey(clusterversion.TODODelete_V22_2TrigramInvertedIndexes)) if err != nil { return nil, err } @@ -1238,7 +1238,7 @@ func (og *operationGenerator) createTable(ctx context.Context, tx pgx.Tx) (*opSt invisibleIndexesIsNotSupported, err := isClusterVersionLessThan( ctx, tx, - clusterversion.ByKey(clusterversion.V22_2Start)) + clusterversion.ByKey(clusterversion.TODODelete_V22_2Start)) if err != nil { return nil, err } @@ -2432,7 +2432,7 @@ func (og *operationGenerator) insertRow(ctx context.Context, tx pgx.Tx) (stmt *o } // If we aren't on 22.2 then disable the insert plugin, since 21.X // can have schema instrospection queries fail due to an optimizer bug. - skipInserts, err := isClusterVersionLessThan(ctx, tx, clusterversion.ByKey(clusterversion.V22_2Start)) + skipInserts, err := isClusterVersionLessThan(ctx, tx, clusterversion.ByKey(clusterversion.TODODelete_V22_2Start)) if err != nil { return nil, err } @@ -3640,6 +3640,6 @@ func isClusterVersionLessThan( func isFkConstraintsEnabled(ctx context.Context, tx pgx.Tx) (bool, error) { fkConstraintDisabledVersion, err := isClusterVersionLessThan(ctx, tx, - clusterversion.ByKey(clusterversion.V22_2Start)) + clusterversion.ByKey(clusterversion.TODODelete_V22_2Start)) return !fkConstraintDisabledVersion, err }