Skip to content

Commit

Permalink
Merge #96468 #96754
Browse files Browse the repository at this point in the history
96468: sql: add test for builtin that belongs to information_schema r=rafiss a=rafiss

Epic: None

This tests the change in 3f50d81

Release note: None

96754: clusterversion: rename V22_2* gates to TODODelete_V22_2* r=RaduBerinde a=celiala

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*`.

Actual gate deletion and related logic/migrations will be done async by teams.

Issue: #95530
Epic: CRDB-23572

Release note: None

Co-authored-by: Rafi Shamim <[email protected]>
Co-authored-by: Celia La <[email protected]>
  • Loading branch information
3 people committed Feb 8, 2023
3 parents ff67a4b + cba72da + 2b730a0 commit d4f63d7
Show file tree
Hide file tree
Showing 70 changed files with 275 additions and 265 deletions.
2 changes: 1 addition & 1 deletion pkg/ccl/backupccl/datadriven_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/ccl/backupccl/restore_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)`
Expand Down
2 changes: 1 addition & 1 deletion pkg/ccl/backupccl/restore_planning.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/ccl/backupccl/system_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down
4 changes: 2 additions & 2 deletions pkg/ccl/changefeedccl/cdceval/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion pkg/cloud/amazon/aws_kms.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/cloud/amazon/s3_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/cloud/cloudprivilege/privileges.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pkg/cloud/gcp/gcp_kms.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/cloud/gcp/gcs_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down
Loading

0 comments on commit d4f63d7

Please sign in to comment.