diff --git a/pkg/ccl/changefeedccl/cdceval/BUILD.bazel b/pkg/ccl/changefeedccl/cdceval/BUILD.bazel index db566987ab17..4ec1c9641fea 100644 --- a/pkg/ccl/changefeedccl/cdceval/BUILD.bazel +++ b/pkg/ccl/changefeedccl/cdceval/BUILD.bazel @@ -18,7 +18,6 @@ go_library( deps = [ "//pkg/ccl/changefeedccl/cdcevent", "//pkg/ccl/changefeedccl/changefeedbase", - "//pkg/clusterversion", "//pkg/jobs/jobspb", "//pkg/roachpb", "//pkg/security/username", diff --git a/pkg/ccl/changefeedccl/cdceval/validation.go b/pkg/ccl/changefeedccl/cdceval/validation.go index 69ed07a4e647..844641cd7839 100644 --- a/pkg/ccl/changefeedccl/cdceval/validation.go +++ b/pkg/ccl/changefeedccl/cdceval/validation.go @@ -12,7 +12,6 @@ import ( "context" "github.com/cockroachdb/cockroach/pkg/ccl/changefeedccl/cdcevent" - "github.com/cockroachdb/cockroach/pkg/clusterversion" "github.com/cockroachdb/cockroach/pkg/jobs/jobspb" "github.com/cockroachdb/cockroach/pkg/sql" "github.com/cockroachdb/cockroach/pkg/sql/catalog" @@ -80,12 +79,6 @@ func normalizeAndValidateSelectForTarget( } }() - 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.TODODelete_V22_2EnablePredicateProjectionChangefeed.String()) - } - // This really shouldn't happen as it's enforced by sql.y. if len(sc.From.Tables) != 1 { return nil, pgerror.Newf(pgcode.Syntax, diff --git a/pkg/cloud/amazon/BUILD.bazel b/pkg/cloud/amazon/BUILD.bazel index bb2c3b4ed88f..635471589d79 100644 --- a/pkg/cloud/amazon/BUILD.bazel +++ b/pkg/cloud/amazon/BUILD.bazel @@ -17,7 +17,6 @@ go_library( "//pkg/cloud/externalconn", "//pkg/cloud/externalconn/connectionpb", "//pkg/cloud/externalconn/utils", - "//pkg/clusterversion", "//pkg/server/telemetry", "//pkg/settings", "//pkg/settings/cluster", diff --git a/pkg/cloud/amazon/aws_kms.go b/pkg/cloud/amazon/aws_kms.go index a09346a3c99c..1735b2aad8e6 100644 --- a/pkg/cloud/amazon/aws_kms.go +++ b/pkg/cloud/amazon/aws_kms.go @@ -22,7 +22,6 @@ import ( "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/kms" "github.com/cockroachdb/cockroach/pkg/cloud" - "github.com/cockroachdb/cockroach/pkg/clusterversion" "github.com/cockroachdb/cockroach/pkg/settings" "github.com/cockroachdb/cockroach/pkg/util" "github.com/cockroachdb/cockroach/pkg/util/log" @@ -196,10 +195,6 @@ func MakeAWSKMS(ctx context.Context, uri string, env cloud.KMSEnv) (cloud.KMS, e } if kmsURIParams.roleProvider != (roleProvider{}) { - 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") - } - // If there are delegate roles in the assume-role chain, we create a session // for each role in order for it to fetch the credentials from the next role // in the chain. diff --git a/pkg/cloud/amazon/s3_storage.go b/pkg/cloud/amazon/s3_storage.go index 1ce127b191de..879690da763b 100644 --- a/pkg/cloud/amazon/s3_storage.go +++ b/pkg/cloud/amazon/s3_storage.go @@ -33,7 +33,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/base" "github.com/cockroachdb/cockroach/pkg/cloud" "github.com/cockroachdb/cockroach/pkg/cloud/cloudpb" - "github.com/cockroachdb/cockroach/pkg/clusterversion" "github.com/cockroachdb/cockroach/pkg/server/telemetry" "github.com/cockroachdb/cockroach/pkg/settings" "github.com/cockroachdb/cockroach/pkg/settings/cluster" @@ -566,10 +565,6 @@ func newClient( } if conf.assumeRoleProvider.roleARN != "" { - 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") - } - for _, delegateProvider := range conf.delegateRoleProviders { intermediateCreds := stscreds.NewCredentials(sess, delegateProvider.roleARN, withExternalID(delegateProvider.externalID)) opts.Config.Credentials = intermediateCreds diff --git a/pkg/cloud/cloudprivilege/BUILD.bazel b/pkg/cloud/cloudprivilege/BUILD.bazel index 61aeeeca4123..5a6efa26e4d0 100644 --- a/pkg/cloud/cloudprivilege/BUILD.bazel +++ b/pkg/cloud/cloudprivilege/BUILD.bazel @@ -25,7 +25,6 @@ go_library( deps = [ "//pkg/cloud", "//pkg/cloud/cloudpb", - "//pkg/clusterversion", "//pkg/sql", "//pkg/sql/pgwire/pgcode", "//pkg/sql/pgwire/pgerror", diff --git a/pkg/cloud/cloudprivilege/privileges.go b/pkg/cloud/cloudprivilege/privileges.go index 32b1258921a7..b7e574fa0b7b 100644 --- a/pkg/cloud/cloudprivilege/privileges.go +++ b/pkg/cloud/cloudprivilege/privileges.go @@ -15,7 +15,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/cloud" "github.com/cockroachdb/cockroach/pkg/cloud/cloudpb" - "github.com/cockroachdb/cockroach/pkg/clusterversion" "github.com/cockroachdb/cockroach/pkg/sql" "github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgcode" "github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgerror" @@ -59,11 +58,6 @@ 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.TODODelete_V22_2SystemExternalConnectionsTable) { - return pgerror.Newf(pgcode.FeatureNotSupported, - "version %v must be finalized to backup to an External Connection", - clusterversion.ByKey(clusterversion.TODODelete_V22_2SystemExternalConnectionsTable)) - } ecPrivilege := &syntheticprivilege.ExternalConnectionPrivilege{ ConnectionName: conf.ExternalConnectionConfig.Name, } diff --git a/pkg/cloud/gcp/BUILD.bazel b/pkg/cloud/gcp/BUILD.bazel index d4443301a47d..bf3c7b0bfd0a 100644 --- a/pkg/cloud/gcp/BUILD.bazel +++ b/pkg/cloud/gcp/BUILD.bazel @@ -18,7 +18,6 @@ go_library( "//pkg/cloud/externalconn", "//pkg/cloud/externalconn/connectionpb", "//pkg/cloud/externalconn/utils", - "//pkg/clusterversion", "//pkg/server/telemetry", "//pkg/settings", "//pkg/settings/cluster", diff --git a/pkg/cloud/gcp/gcp_kms.go b/pkg/cloud/gcp/gcp_kms.go index 26f8fb99700b..7b34502b48a2 100644 --- a/pkg/cloud/gcp/gcp_kms.go +++ b/pkg/cloud/gcp/gcp_kms.go @@ -19,7 +19,6 @@ import ( kms "cloud.google.com/go/kms/apiv1" kmspb "cloud.google.com/go/kms/apiv1/kmspb" "github.com/cockroachdb/cockroach/pkg/cloud" - "github.com/cockroachdb/cockroach/pkg/clusterversion" "github.com/cockroachdb/errors" "google.golang.org/api/option" "google.golang.org/protobuf/types/known/wrapperspb" @@ -127,10 +126,6 @@ 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.TODODelete_V22_2SupportAssumeRoleAuth) { - return nil, errors.New("cannot authenticate to KMS via assume role until cluster has fully upgraded to 22.2") - } - assumeOpt, err := createImpersonateCredentials(ctx, kmsURIParams.assumeRole, kmsURIParams.delegateRoles, kms.DefaultAuthScopes(), credentialsOpt...) if err != nil { return nil, cloud.KMSInaccessible(errors.Wrapf(err, "failed to assume role")) diff --git a/pkg/cloud/gcp/gcs_storage.go b/pkg/cloud/gcp/gcs_storage.go index 166a4711ced2..b57f9bce375f 100644 --- a/pkg/cloud/gcp/gcs_storage.go +++ b/pkg/cloud/gcp/gcs_storage.go @@ -23,7 +23,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/base" "github.com/cockroachdb/cockroach/pkg/cloud" "github.com/cockroachdb/cockroach/pkg/cloud/cloudpb" - "github.com/cockroachdb/cockroach/pkg/clusterversion" "github.com/cockroachdb/cockroach/pkg/server/telemetry" "github.com/cockroachdb/cockroach/pkg/settings" "github.com/cockroachdb/cockroach/pkg/settings/cluster" @@ -182,10 +181,6 @@ func makeGCSStorage( if conf.AssumeRole == "" { opts = append(opts, credentialsOpt...) } else { - 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") - } - assumeOpt, err := createImpersonateCredentials(ctx, conf.AssumeRole, conf.AssumeRoleDelegates, []string{scope}, credentialsOpt...) if err != nil { return nil, errors.Wrapf(err, "failed to assume role") diff --git a/pkg/clusterversion/cockroach_versions.go b/pkg/clusterversion/cockroach_versions.go index d5b79122ddf1..348277bae61b 100644 --- a/pkg/clusterversion/cockroach_versions.go +++ b/pkg/clusterversion/cockroach_versions.go @@ -174,100 +174,12 @@ const ( // to succeed without actually performing the update. VPrimordialMax - // TODODelete_V22_1 is CockroachDB v22.1. It's used for all v22.1.x patch releases. - TODODelete_V22_1 - // v22.2 versions. // - // TODODelete_V22_2Start demarcates work towards CockroachDB v22.2. - TODODelete_V22_2Start - - // TODODelete_V22_2PebbleFormatSplitUserKeysMarkedCompacted updates the Pebble format - // version that recombines all user keys that may be split across multiple - // files into a single table. - 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. - 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. - TODODelete_V22_2EnablePebbleFormatVersionRangeKeys - // 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_2SystemPrivilegesTable adds system.privileges table. - TODODelete_V22_2SystemPrivilegesTable - // TODODelete_V22_2EnablePredicateProjectionChangefeed indicates that changefeeds support - // predicates and projections. - TODODelete_V22_2EnablePredicateProjectionChangefeed - // TODODelete_V22_2SystemExternalConnectionsTable adds system.external_connections table. - TODODelete_V22_2SystemExternalConnectionsTable - // 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. - TODODelete_V22_2AddSystemUserIDColumn - // TODODelete_V22_2SystemUsersIDColumnIsBackfilled is the version where all users in the system.users table - // have ids. - TODODelete_V22_2SystemUsersIDColumnIsBackfilled - // TODODelete_V22_2SetSystemUsersUserIDColumnNotNull sets the user_id column in system.users to not null. - TODODelete_V22_2SetSystemUsersUserIDColumnNotNull // Permanent_V22_2SQLSchemaTelemetryScheduledJobs adds an automatic schedule for SQL schema // telemetry logging jobs. - // // This is a permanent migration which should exist forever. Permanent_V22_2SQLSchemaTelemetryScheduledJobs - // TODODelete_V22_2SchemaChangeSupportsCreateFunction adds support of CREATE FUNCTION - // statement. - TODODelete_V22_2SchemaChangeSupportsCreateFunction - // 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 - // the minimum supported sstable format to (Pebble,v1) (block properties). New - // tables generated by Pebble (via compactions / flushes), and tables written - // for ingestion will be at table format version (Pebble,v1). - // - Each store is then instructed to mark all existing tables that are - // 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. - TODODelete_V22_2PebbleFormatPrePebblev1Marked - // TODODelete_V22_2RoleOptionsTableHasIDColumn is the version where the role options table - // has ids. - TODODelete_V22_2RoleOptionsTableHasIDColumn - // TODODelete_V22_2RoleOptionsIDColumnIsBackfilled is the version where ids in the role options - // table are backfilled. - 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. - TODODelete_V22_2SetRoleOptionsUserIDColumnNotNull - // TODODelete_V22_2RangefeedUseOneStreamPerNode changes rangefeed implementation to use 1 RPC stream per node. - TODODelete_V22_2RangefeedUseOneStreamPerNode - // TODODelete_V22_2TTLDistSQL uses DistSQL to distribute TTL SELECT/DELETE statements to - // leaseholder nodes. - 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. - 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 - // the incoming leaseholder would need to recognize itself as such within a - // few seconds. This needs version gating so that in mixed-version clusters, - // 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. - TODODelete_V22_2EnableLeaseUpgrade - // TODODelete_V22_2SupportAssumeRoleAuth is the version where assume role authorization is - // supported in cloud storage and KMS. - TODODelete_V22_2SupportAssumeRoleAuth // V22_2 is CockroachDB v22.2. It's used for all v22.2.x patch releases. V22_2 @@ -635,108 +547,12 @@ var rawVersionsSingleton = keyedVersions{ Key: VPrimordialMax, Version: roachpb.Version{Major: 0, Minor: 0, Internal: 424242}, }, - { - Key: TODODelete_V22_1, - Version: roachpb.Version{Major: 22, Minor: 1}, - }, // v22.2 versions. Internal versions must be even. - { - Key: TODODelete_V22_2Start, - Version: roachpb.Version{Major: 22, Minor: 1, Internal: 2}, - }, - { - Key: TODODelete_V22_2PebbleFormatSplitUserKeysMarkedCompacted, - Version: roachpb.Version{Major: 22, Minor: 1, Internal: 6}, - }, - { - Key: TODODelete_V22_2EnsurePebbleFormatVersionRangeKeys, - Version: roachpb.Version{Major: 22, Minor: 1, Internal: 8}, - }, - { - Key: TODODelete_V22_2EnablePebbleFormatVersionRangeKeys, - Version: roachpb.Version{Major: 22, Minor: 1, Internal: 10}, - }, - { - Key: TODODelete_V22_2RemoveGrantPrivilege, - Version: roachpb.Version{Major: 22, Minor: 1, Internal: 14}, - }, - { - Key: TODODelete_V22_2MVCCRangeTombstones, - Version: roachpb.Version{Major: 22, Minor: 1, Internal: 16}, - }, - { - Key: TODODelete_V22_2SystemPrivilegesTable, - Version: roachpb.Version{Major: 22, Minor: 1, Internal: 24}, - }, - { - Key: TODODelete_V22_2EnablePredicateProjectionChangefeed, - Version: roachpb.Version{Major: 22, Minor: 1, Internal: 26}, - }, - { - Key: TODODelete_V22_2SystemExternalConnectionsTable, - Version: roachpb.Version{Major: 22, Minor: 1, Internal: 30}, - }, - { - Key: TODODelete_V22_2RoleIDSequence, - Version: roachpb.Version{Major: 22, Minor: 1, Internal: 34}, - }, - { - Key: TODODelete_V22_2AddSystemUserIDColumn, - Version: roachpb.Version{Major: 22, Minor: 1, Internal: 36}, - }, - { - Key: TODODelete_V22_2SystemUsersIDColumnIsBackfilled, - Version: roachpb.Version{Major: 22, Minor: 1, Internal: 38}, - }, - { - Key: TODODelete_V22_2SetSystemUsersUserIDColumnNotNull, - Version: roachpb.Version{Major: 22, Minor: 1, Internal: 40}, - }, { Key: Permanent_V22_2SQLSchemaTelemetryScheduledJobs, Version: roachpb.Version{Major: 22, Minor: 1, Internal: 42}, }, - { - Key: TODODelete_V22_2SchemaChangeSupportsCreateFunction, - Version: roachpb.Version{Major: 22, Minor: 1, Internal: 44}, - }, - { - Key: TODODelete_V22_2PebbleFormatPrePebblev1Marked, - Version: roachpb.Version{Major: 22, Minor: 1, Internal: 48}, - }, - { - Key: TODODelete_V22_2RoleOptionsTableHasIDColumn, - Version: roachpb.Version{Major: 22, Minor: 1, Internal: 50}, - }, - { - Key: TODODelete_V22_2RoleOptionsIDColumnIsBackfilled, - Version: roachpb.Version{Major: 22, Minor: 1, Internal: 52}, - }, - { - Key: TODODelete_V22_2SetRoleOptionsUserIDColumnNotNull, - Version: roachpb.Version{Major: 22, Minor: 1, Internal: 54}, - }, - { - Key: TODODelete_V22_2RangefeedUseOneStreamPerNode, - Version: roachpb.Version{Major: 22, Minor: 1, Internal: 60}, - }, - { - Key: TODODelete_V22_2TTLDistSQL, - Version: roachpb.Version{Major: 22, Minor: 1, Internal: 68}, - }, - { - Key: TODODelete_V22_2PrioritizeSnapshots, - Version: roachpb.Version{Major: 22, Minor: 1, Internal: 70}, - }, - { - Key: TODODelete_V22_2EnableLeaseUpgrade, - Version: roachpb.Version{Major: 22, Minor: 1, Internal: 72}, - }, - { - Key: TODODelete_V22_2SupportAssumeRoleAuth, - Version: roachpb.Version{Major: 22, Minor: 1, Internal: 74}, - }, { Key: V22_2, Version: roachpb.Version{Major: 22, Minor: 2, Internal: 0}, diff --git a/pkg/kv/kvclient/kvcoord/dist_sender_rangefeed.go b/pkg/kv/kvclient/kvcoord/dist_sender_rangefeed.go index 6b0b45d25b7e..0e455225fb11 100644 --- a/pkg/kv/kvclient/kvcoord/dist_sender_rangefeed.go +++ b/pkg/kv/kvclient/kvcoord/dist_sender_rangefeed.go @@ -20,7 +20,6 @@ import ( "time" "unsafe" - "github.com/cockroachdb/cockroach/pkg/clusterversion" "github.com/cockroachdb/cockroach/pkg/keys" "github.com/cockroachdb/cockroach/pkg/kv/kvclient/rangecache" "github.com/cockroachdb/cockroach/pkg/kv/kvpb" @@ -223,8 +222,7 @@ func (ds *DistSender) RangeFeedSpans( rl := newCatchupScanRateLimiter(&ds.st.SV) - if ds.st.Version.IsActive(ctx, clusterversion.TODODelete_V22_2RangefeedUseOneStreamPerNode) && - enableMuxRangeFeed && cfg.useMuxRangeFeed { + if enableMuxRangeFeed && cfg.useMuxRangeFeed { return muxRangeFeed(ctx, cfg, spans, ds, rr, rl, eventCh) } diff --git a/pkg/kv/kvclient/kvcoord/dist_sender_rangefeed_test.go b/pkg/kv/kvclient/kvcoord/dist_sender_rangefeed_test.go index da6eb46baf08..f2a943a1906d 100644 --- a/pkg/kv/kvclient/kvcoord/dist_sender_rangefeed_test.go +++ b/pkg/kv/kvclient/kvcoord/dist_sender_rangefeed_test.go @@ -21,7 +21,6 @@ import ( "time" "github.com/cockroachdb/cockroach/pkg/base" - "github.com/cockroachdb/cockroach/pkg/clusterversion" "github.com/cockroachdb/cockroach/pkg/keys" "github.com/cockroachdb/cockroach/pkg/kv/kvclient/kvcoord" "github.com/cockroachdb/cockroach/pkg/kv/kvpb" @@ -29,8 +28,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/roachpb" "github.com/cockroachdb/cockroach/pkg/rpc" "github.com/cockroachdb/cockroach/pkg/rpc/nodedialer" - "github.com/cockroachdb/cockroach/pkg/server" - "github.com/cockroachdb/cockroach/pkg/settings/cluster" "github.com/cockroachdb/cockroach/pkg/sql/catalog/desctestutils" "github.com/cockroachdb/cockroach/pkg/testutils" "github.com/cockroachdb/cockroach/pkg/testutils/sqlutils" @@ -268,71 +265,6 @@ func channelWaitWithTimeout(t *testing.T, ch chan struct{}) { t.Fatal("test timed out") } } -func TestBiDirectionalRangefeedNotUsedUntilUpgradeFinalilzed(t *testing.T) { - defer leaktest.AfterTest(t)() - defer log.Scope(t).Close(t) - - ctx := context.Background() - - startServerAtVer := func(ver roachpb.Version) (*testcluster.TestCluster, func()) { - st := cluster.MakeTestingClusterSettingsWithVersions(ver, ver, true) - tc := testcluster.StartTestCluster(t, 3, base.TestClusterArgs{ - ReplicationMode: base.ReplicationManual, // Turn off replication queues. - ServerArgs: base.TestServerArgs{ - Settings: st, - Knobs: base.TestingKnobs{ - KVClient: &kvcoord.ClientTestingKnobs{ - TransportFactory: makeTransportFactory(false, nil, nil), - }, - - Server: &server.TestingKnobs{ - DisableAutomaticVersionUpgrade: make(chan struct{}), - BinaryVersionOverride: ver, - }, - }, - }, - }) - return tc, func() { tc.Stopper().Stop(ctx) } - } - - // Create a small table; run rangefeed. The transport factory we injected above verifies - // that we use the old rangefeed implementation. - runRangeFeed := func(tc *testcluster.TestCluster, opts ...kvcoord.RangeFeedOption) { - ts := tc.Server(0) - - sqlDB := sqlutils.MakeSQLRunner(tc.ServerConn(0)) - startTime := ts.Clock().Now() - - sqlDB.Exec(t, `SET CLUSTER SETTING kv.rangefeed.enabled = true`) - sqlDB.Exec(t, `CREATE TABLE foo (key INT PRIMARY KEY)`) - sqlDB.Exec(t, `INSERT INTO foo (key) SELECT * FROM generate_series(1, 1000)`) - - fooDesc := desctestutils.TestingGetPublicTableDescriptor( - ts.DB(), keys.SystemSQLCodec, "defaultdb", "foo") - fooSpan := fooDesc.PrimaryIndexSpan(keys.SystemSQLCodec) - - allSeen, onValue := observeNValues(1000) - closeFeed := rangeFeed(ts.DistSenderI(), fooSpan, startTime, onValue, false) - defer closeFeed() - channelWaitWithTimeout(t, allSeen) - } - - t.Run("rangefeed-stream-disabled-prior-to-version-upgrade", func(t *testing.T) { - noRfStreamVer := clusterversion.ByKey(clusterversion.TODODelete_V22_2RangefeedUseOneStreamPerNode - 1) - tc, cleanup := startServerAtVer(noRfStreamVer) - defer cleanup() - runRangeFeed(tc) - }) - - 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.TODODelete_V22_2RangefeedUseOneStreamPerNode) - tc, cleanup := startServerAtVer(rfStreamVer) - defer cleanup() - runRangeFeed(tc, kvcoord.WithMuxRangeFeed()) - }) -} func TestMuxRangeFeedConnectsToNodeOnce(t *testing.T) { defer leaktest.AfterTest(t)() diff --git a/pkg/kv/kvserver/client_lease_test.go b/pkg/kv/kvserver/client_lease_test.go index beeec61221bc..ecbb6230c3c2 100644 --- a/pkg/kv/kvserver/client_lease_test.go +++ b/pkg/kv/kvserver/client_lease_test.go @@ -22,7 +22,6 @@ import ( "time" "github.com/cockroachdb/cockroach/pkg/base" - "github.com/cockroachdb/cockroach/pkg/clusterversion" "github.com/cockroachdb/cockroach/pkg/config/zonepb" "github.com/cockroachdb/cockroach/pkg/gossip" "github.com/cockroachdb/cockroach/pkg/keys" @@ -1566,79 +1565,6 @@ func TestLeaseTransfersUseExpirationLeasesAndBumpToEpochBasedOnes(t *testing.T) require.Equal(t, roachpb.LeaseExpiration, mu.lease.Type()) } -// TestLeaseUpgradeVersionGate tests the version gating for the lease-upgrade -// process. -// -// TODO(irfansharif): Delete this in 23.1 (or whenever we get rid of the -// clusterversion.EnableLeaseUpgrade). -func TestLeaseUpgradeVersionGate(t *testing.T) { - defer leaktest.AfterTest(t)() - defer log.Scope(t).Close(t) - - ctx := context.Background() - st := cluster.MakeTestingClusterSettingsWithVersions( - clusterversion.TestingBinaryVersion, - clusterversion.ByKey(clusterversion.TODODelete_V22_2EnableLeaseUpgrade-1), - false, /* initializeVersion */ - ) - kvserver.ExpirationLeasesOnly.Override(ctx, &st.SV, false) // override metamorphism - - tci := serverutils.StartCluster(t, 2, base.TestClusterArgs{ - ReplicationMode: base.ReplicationManual, - ServerArgs: base.TestServerArgs{ - Settings: st, - Knobs: base.TestingKnobs{ - Server: &server.TestingKnobs{ - DisableAutomaticVersionUpgrade: make(chan struct{}), - BinaryVersionOverride: clusterversion.ByKey(clusterversion.TODODelete_V22_2EnableLeaseUpgrade - 1), - }, - }, - }, - }) - tc := tci.(*testcluster.TestCluster) - defer tc.Stopper().Stop(ctx) - - scratchKey := tc.ScratchRange(t) - n1, n1Target := tc.Server(0), tc.Target(0) - n2, n2Target := tc.Server(1), tc.Target(1) - - // Add a replica; we're going to move the lease to and from it below. - desc := tc.AddVotersOrFatal(t, scratchKey, n2Target) - - // Transfer the lease from n1 to n2. It should be transferred as an - // epoch-based one since we've not upgraded past - // clusterversion.EnableLeaseUpgrade yet. - tc.TransferRangeLeaseOrFatal(t, desc, n2Target) - testutils.SucceedsSoon(t, func() error { - li, _, err := tc.FindRangeLeaseEx(ctx, desc, nil) - require.NoError(t, err) - if !li.Current().OwnedBy(n2.GetFirstStoreID()) { - return errors.New("lease still owned by n1") - } - require.Equal(t, roachpb.LeaseEpoch, li.Current().Type()) - return nil - }) - - // Enable the version gate. - _, err := tc.Conns[0].ExecContext(ctx, `SET CLUSTER SETTING version = $1`, - 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 - // expiration-based lease that's later upgraded to an epoch based one now - // that we're past the version gate. - tc.TransferRangeLeaseOrFatal(t, desc, n1Target) - testutils.SucceedsSoon(t, func() error { - li, _, err := tc.FindRangeLeaseEx(ctx, desc, nil) - require.NoError(t, err) - if !li.Current().OwnedBy(n1.GetFirstStoreID()) { - return errors.New("lease still owned by n2") - } - return nil - }) - tc.WaitForLeaseUpgrade(ctx, t, desc) -} - // TestLeaseRequestBumpsEpoch tests that a non-cooperative lease acquisition of // an expired epoch lease always bumps the epoch of the outgoing leaseholder, // regardless of the type of lease being acquired. diff --git a/pkg/kv/kvserver/replica_range_lease.go b/pkg/kv/kvserver/replica_range_lease.go index f5a36ff6ff50..407e6c149c16 100644 --- a/pkg/kv/kvserver/replica_range_lease.go +++ b/pkg/kv/kvserver/replica_range_lease.go @@ -48,7 +48,6 @@ import ( "time" "github.com/cockroachdb/cockroach/pkg/base" - "github.com/cockroachdb/cockroach/pkg/clusterversion" "github.com/cockroachdb/cockroach/pkg/keys" "github.com/cockroachdb/cockroach/pkg/kv/kvpb" "github.com/cockroachdb/cockroach/pkg/kv/kvserver/constraint" @@ -296,8 +295,7 @@ func (p *pendingLeaseRequest) InitOrJoinRequest( if p.repl.shouldUseExpirationLeaseRLocked() || (transfer && - TransferExpirationLeasesFirstEnabled.Get(&p.repl.store.ClusterSettings().SV) && - p.repl.store.ClusterSettings().Version.IsActive(ctx, clusterversion.TODODelete_V22_2EnableLeaseUpgrade)) { + TransferExpirationLeasesFirstEnabled.Get(&p.repl.store.ClusterSettings().SV)) { // In addition to ranges that should be using expiration-based leases // (typically the meta and liveness ranges), we also use them during lease // transfers for all other ranges. After acquiring these expiration based diff --git a/pkg/sql/create_external_connection.go b/pkg/sql/create_external_connection.go index 63c2b4f6c32b..1cf3cab3619d 100644 --- a/pkg/sql/create_external_connection.go +++ b/pkg/sql/create_external_connection.go @@ -70,12 +70,6 @@ func (p *planner) createExternalConnection( ) error { txn := p.InternalSQLTxn() - 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.TODODelete_V22_2SystemExternalConnectionsTable)) - } - if err := params.p.CheckPrivilege(params.ctx, syntheticprivilege.GlobalPrivilegeObject, privilege.EXTERNALCONNECTION); err != nil { return pgerror.New( diff --git a/pkg/sql/drop_external_connection.go b/pkg/sql/drop_external_connection.go index d3e42132995c..2b922cd452ed 100644 --- a/pkg/sql/drop_external_connection.go +++ b/pkg/sql/drop_external_connection.go @@ -13,9 +13,6 @@ package sql import ( "context" - "github.com/cockroachdb/cockroach/pkg/clusterversion" - "github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgcode" - "github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgerror" "github.com/cockroachdb/cockroach/pkg/sql/privilege" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/sessiondata" @@ -41,12 +38,6 @@ 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.TODODelete_V22_2SystemExternalConnectionsTable) { - return pgerror.Newf(pgcode.FeatureNotSupported, - "External Connections are not supported until upgrade to version %v is finalized", - clusterversion.ByKey(clusterversion.TODODelete_V22_2SystemExternalConnectionsTable)) - } - // TODO(adityamaru): Add some metrics to track DROP EXTERNAL CONNECTION // usage. diff --git a/pkg/sql/grant_revoke_system.go b/pkg/sql/grant_revoke_system.go index 1a04f4a2bedb..88c617f95013 100644 --- a/pkg/sql/grant_revoke_system.go +++ b/pkg/sql/grant_revoke_system.go @@ -263,11 +263,6 @@ func (n *changeNonDescriptorBackedPrivilegesNode) makeSystemPrivilegeObject( } return ret, nil case privilege.ExternalConnection: - 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.TODODelete_V22_2SystemExternalConnectionsTable.String()) - } - var ret []syntheticprivilege.Object for _, externalConnectionName := range n.targets.ExternalConnections { // Ensure that an External Connection of this name actually exists. diff --git a/pkg/sql/importer/import_job.go b/pkg/sql/importer/import_job.go index 0ff5caba3f7e..17fce4929669 100644 --- a/pkg/sql/importer/import_job.go +++ b/pkg/sql/importer/import_job.go @@ -277,13 +277,10 @@ 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.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) - if err != nil { - return err - } + // Update the descriptor in the job record and in the database with the ImportStartTime + details.Tables[i].Desc.ImportStartWallTime = details.Walltime + if err := bindImportStartTime(ctx, p, tblDesc.GetID(), details.Walltime); err != nil { + return err } } } diff --git a/pkg/sql/schemachanger/scbuild/build.go b/pkg/sql/schemachanger/scbuild/build.go index 41476f2d364d..6f086f682529 100644 --- a/pkg/sql/schemachanger/scbuild/build.go +++ b/pkg/sql/schemachanger/scbuild/build.go @@ -125,7 +125,7 @@ func makeState( } loggedTargets = make([]scpb.Target, 0, len(bs.output)) isElementAllowedInVersion := func(e scpb.Element) bool { - if !version.IsActive(screl.MinElementVersion(e)) { + if !screl.VersionSupportsElementUse(e, version) { // Exclude targets which are not yet usable in the currently active // cluster version. return false diff --git a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/process.go b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/process.go index 237bb967d30e..1d0421301fcc 100644 --- a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/process.go +++ b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/process.go @@ -48,13 +48,13 @@ var supportedStatements = map[reflect.Type]supportedStatement{ // here. reflect.TypeOf((*tree.AlterTable)(nil)): {fn: AlterTable, statementTag: tree.AlterTableTag, on: true, checks: alterTableChecks}, reflect.TypeOf((*tree.CreateIndex)(nil)): {fn: CreateIndex, statementTag: tree.CreateIndexTag, on: true, checks: isV231Active}, - reflect.TypeOf((*tree.DropDatabase)(nil)): {fn: DropDatabase, statementTag: tree.DropDatabaseTag, on: true, checks: isV221Active}, + reflect.TypeOf((*tree.DropDatabase)(nil)): {fn: DropDatabase, statementTag: tree.DropDatabaseTag, on: true, checks: nil}, reflect.TypeOf((*tree.DropOwnedBy)(nil)): {fn: DropOwnedBy, statementTag: tree.DropOwnedByTag, on: true, checks: isV222Active}, - reflect.TypeOf((*tree.DropSchema)(nil)): {fn: DropSchema, statementTag: tree.DropSchemaTag, on: true, checks: isV221Active}, - reflect.TypeOf((*tree.DropSequence)(nil)): {fn: DropSequence, statementTag: tree.DropSequenceTag, on: true, checks: isV221Active}, - reflect.TypeOf((*tree.DropTable)(nil)): {fn: DropTable, statementTag: tree.DropTableTag, on: true, checks: isV221Active}, - reflect.TypeOf((*tree.DropType)(nil)): {fn: DropType, statementTag: tree.DropTypeTag, on: true, checks: isV221Active}, - reflect.TypeOf((*tree.DropView)(nil)): {fn: DropView, statementTag: tree.DropViewTag, on: true, checks: isV221Active}, + reflect.TypeOf((*tree.DropSchema)(nil)): {fn: DropSchema, statementTag: tree.DropSchemaTag, on: true, checks: nil}, + reflect.TypeOf((*tree.DropSequence)(nil)): {fn: DropSequence, statementTag: tree.DropSequenceTag, on: true, checks: nil}, + reflect.TypeOf((*tree.DropTable)(nil)): {fn: DropTable, statementTag: tree.DropTableTag, on: true, checks: nil}, + reflect.TypeOf((*tree.DropType)(nil)): {fn: DropType, statementTag: tree.DropTypeTag, on: true, checks: nil}, + reflect.TypeOf((*tree.DropView)(nil)): {fn: DropView, statementTag: tree.DropViewTag, on: true, checks: nil}, reflect.TypeOf((*tree.CommentOnConstraint)(nil)): {fn: CommentOnConstraint, statementTag: tree.CommentOnConstraintTag, on: true, checks: isV222Active}, reflect.TypeOf((*tree.CommentOnDatabase)(nil)): {fn: CommentOnDatabase, statementTag: tree.CommentOnDatabaseTag, on: true, checks: isV222Active}, reflect.TypeOf((*tree.CommentOnSchema)(nil)): {fn: CommentOnSchema, statementTag: tree.CommentOnSchemaTag, on: true, checks: isV222Active}, @@ -203,10 +203,6 @@ func getDeclarativeSchemaChangerModeForStmt( return ret } -var isV221Active = func(_ tree.NodeFormatter, _ sessiondatapb.NewSchemaChangerMode, activeVersion clusterversion.ClusterVersion) bool { - return activeVersion.IsActive(clusterversion.TODODelete_V22_1) -} - var isV222Active = func(_ tree.NodeFormatter, _ sessiondatapb.NewSchemaChangerMode, activeVersion clusterversion.ClusterVersion) bool { return activeVersion.IsActive(clusterversion.V22_2) } diff --git a/pkg/sql/schemachanger/scplan/internal/rules/helpers.go b/pkg/sql/schemachanger/scplan/internal/rules/helpers.go index 7f9f454fc985..90dee0c147e7 100644 --- a/pkg/sql/schemachanger/scplan/internal/rules/helpers.go +++ b/pkg/sql/schemachanger/scplan/internal/rules/helpers.go @@ -273,7 +273,7 @@ func ForEachElementInActiveVersion( version clusterversion.ClusterVersion, fn func(element scpb.Element) error, ) error { return scpb.ForEachElementType(func(e scpb.Element) error { - if version.IsActive(screl.MinElementVersion(e)) { + if screl.VersionSupportsElementUse(e, version) { if err := fn(e); err != nil { return iterutil.Map(err) } diff --git a/pkg/sql/schemachanger/screl/BUILD.bazel b/pkg/sql/schemachanger/screl/BUILD.bazel index e130334d37e7..3904635e8dc4 100644 --- a/pkg/sql/schemachanger/screl/BUILD.bazel +++ b/pkg/sql/schemachanger/screl/BUILD.bazel @@ -44,6 +44,7 @@ go_test( args = ["-test.timeout=55s"], embed = [":screl"], deps = [ + "//pkg/clusterversion", "//pkg/sql/catalog/catpb", "//pkg/sql/catalog/descpb", "//pkg/sql/schemachanger/rel", diff --git a/pkg/sql/schemachanger/screl/scalars.go b/pkg/sql/schemachanger/screl/scalars.go index 618bce5c0ed4..c058559de29d 100644 --- a/pkg/sql/schemachanger/screl/scalars.go +++ b/pkg/sql/schemachanger/screl/scalars.go @@ -102,9 +102,8 @@ func ContainsDescID(haystack scpb.Element, needle catid.DescID) (contains bool) return contains } -// MinElementVersion returns the minimum cluster version at which an element may -// be used. -func MinElementVersion(el scpb.Element) clusterversion.Key { +// VersionSupportsElementUse checks if an element may be used at a given version. +func VersionSupportsElementUse(el scpb.Element, version clusterversion.ClusterVersion) bool { switch el.(type) { case *scpb.Database, *scpb.Schema, *scpb.View, *scpb.Sequence, *scpb.Table, *scpb.AliasType, *scpb.ColumnFamily, *scpb.Column, *scpb.PrimaryIndex, @@ -120,21 +119,19 @@ func MinElementVersion(el scpb.Element) clusterversion.Key { *scpb.Namespace, *scpb.Owner, *scpb.UserPrivileges, *scpb.DatabaseRegionConfig, *scpb.DatabaseRoleSetting, *scpb.DatabaseComment, *scpb.SchemaParent, *scpb.SchemaComment, *scpb.SchemaChild: - return clusterversion.TODODelete_V22_1 - case *scpb.CompositeType, *scpb.CompositeTypeAttrType, *scpb.CompositeTypeAttrName: - return clusterversion.V23_1 + // These elements need v22.1 so they can be used without checking any version gates. + return true case *scpb.IndexColumn, *scpb.EnumTypeValue, *scpb.TableZoneConfig: - return clusterversion.V22_2 + return version.IsActive(clusterversion.V22_2) case *scpb.DatabaseData, *scpb.TableData, *scpb.IndexData, *scpb.TablePartitioning, *scpb.Function, *scpb.FunctionName, *scpb.FunctionVolatility, *scpb.FunctionLeakProof, - *scpb.FunctionNullInputBehavior, *scpb.FunctionBody, *scpb.FunctionParamDefaultExpression: - return clusterversion.V23_1 - case *scpb.ColumnNotNull, *scpb.CheckConstraintUnvalidated, - *scpb.UniqueWithoutIndexConstraintUnvalidated, *scpb.ForeignKeyConstraintUnvalidated, - *scpb.IndexZoneConfig, *scpb.TableSchemaLocked: - return clusterversion.V23_1 + *scpb.FunctionNullInputBehavior, *scpb.FunctionBody, *scpb.FunctionParamDefaultExpression, + *scpb.ColumnNotNull, *scpb.CheckConstraintUnvalidated, *scpb.UniqueWithoutIndexConstraintUnvalidated, + *scpb.ForeignKeyConstraintUnvalidated, *scpb.IndexZoneConfig, *scpb.TableSchemaLocked, *scpb.CompositeType, + *scpb.CompositeTypeAttrType, *scpb.CompositeTypeAttrName: + return version.IsActive(clusterversion.V23_1) case *scpb.SequenceOption: - return clusterversion.V23_2 + return version.IsActive(clusterversion.V23_2) default: panic(errors.AssertionFailedf("unknown element %T", el)) } diff --git a/pkg/sql/schemachanger/screl/scalars_test.go b/pkg/sql/schemachanger/screl/scalars_test.go index 99fe24640639..2ca902056805 100644 --- a/pkg/sql/schemachanger/screl/scalars_test.go +++ b/pkg/sql/schemachanger/screl/scalars_test.go @@ -15,6 +15,7 @@ import ( "reflect" "testing" + "github.com/cockroachdb/cockroach/pkg/clusterversion" "github.com/cockroachdb/cockroach/pkg/sql/catalog/descpb" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scpb" "github.com/cockroachdb/cockroach/pkg/sql/sem/catid" @@ -32,7 +33,7 @@ func TestAllElementsHaveDescID(t *testing.T) { func TestAllElementsHaveMinVersion(t *testing.T) { forEachNewElementType(t, func(elem scpb.Element) { // If `elem` does not have a min version, the following function call will panic. - MinElementVersion(elem) + VersionSupportsElementUse(elem, clusterversion.ClusterVersion{}) }) } diff --git a/pkg/upgrade/upgrademanager/manager_external_test.go b/pkg/upgrade/upgrademanager/manager_external_test.go index 94aa904af8b3..6867b5ccd066 100644 --- a/pkg/upgrade/upgrademanager/manager_external_test.go +++ b/pkg/upgrade/upgrademanager/manager_external_test.go @@ -688,7 +688,7 @@ func TestPrecondition(t *testing.T) { version.Internal += 1 return version } - v0 := clusterversion.ByKey(clusterversion.TODODelete_V22_1) + v0 := clusterversion.TestingBinaryMinSupportedVersion v0_fence := fence(v0) v1 := next(v0) v1_fence := fence(v1) diff --git a/pkg/upgrade/upgrades/BUILD.bazel b/pkg/upgrade/upgrades/BUILD.bazel index b02fa27135fe..9fca58592750 100644 --- a/pkg/upgrade/upgrades/BUILD.bazel +++ b/pkg/upgrade/upgrades/BUILD.bazel @@ -29,7 +29,6 @@ go_library( "schemachanger_elements.go", "sql_stats_ttl.go", "system_activity_update_job.go", - "system_external_connections.go", "system_job_info.go", "system_privileges_index_migration.go", "system_privileges_user_id_migration.go", diff --git a/pkg/upgrade/upgrades/system_external_connections.go b/pkg/upgrade/upgrades/system_external_connections.go deleted file mode 100644 index ad051739c4b8..000000000000 --- a/pkg/upgrade/upgrades/system_external_connections.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2022 The Cockroach Authors. -// -// Use of this software is governed by the Business Source License -// included in the file licenses/BSL.txt. -// -// As of the Change Date specified in that file, in accordance with -// the Business Source License, use of this software will be governed -// by the Apache License, Version 2.0, included in the file -// licenses/APL.txt. - -package upgrades - -import ( - "context" - - "github.com/cockroachdb/cockroach/pkg/clusterversion" - "github.com/cockroachdb/cockroach/pkg/sql/catalog/systemschema" - "github.com/cockroachdb/cockroach/pkg/upgrade" -) - -// systemExternalConnectionsTableMigration creates the -// system.external_connections table. -func systemExternalConnectionsTableMigration( - ctx context.Context, _ clusterversion.ClusterVersion, d upgrade.TenantDeps, -) error { - return createSystemTable( - ctx, d.DB.KV(), d.Settings, d.Codec, systemschema.SystemExternalConnectionsTable, - ) -} diff --git a/pkg/upgrade/upgrades/upgrades.go b/pkg/upgrade/upgrades/upgrades.go index 11b01e4e683b..e1d5fb1fa8f2 100644 --- a/pkg/upgrade/upgrades/upgrades.go +++ b/pkg/upgrade/upgrades/upgrades.go @@ -85,20 +85,12 @@ var upgrades = []upgradebase.Upgrade{ updateSystemLocationData, "update system.locations with default location data", // v22_2StartupMigrationName ), - // Introduced in v2.1. - // TODO(knz): bake this migration into v19.1. upgrade.NewPermanentTenantUpgrade( "create default databases", toCV(clusterversion.VPrimordial6), createDefaultDbs, "create default databases", // v22_2StartupMigrationName ), - upgrade.NewTenantUpgrade( - "add the system.external_connections table", - toCV(clusterversion.TODODelete_V22_2SystemExternalConnectionsTable), - upgrade.NoPrecondition, - systemExternalConnectionsTableMigration, - ), upgrade.NewPermanentTenantUpgrade( "add default SQL schema telemetry schedule", toCV(clusterversion.Permanent_V22_2SQLSchemaTelemetryScheduledJobs),