diff --git a/pkg/backup/BUILD.bazel b/pkg/backup/BUILD.bazel index bb7bce02cdd3..c00688db1c27 100644 --- a/pkg/backup/BUILD.bazel +++ b/pkg/backup/BUILD.bazel @@ -50,7 +50,6 @@ go_library( "//pkg/ccl/kvccl/kvfollowerreadsccl", "//pkg/ccl/multiregionccl", "//pkg/ccl/storageccl", - "//pkg/ccl/utilccl", "//pkg/cloud", "//pkg/cloud/cloudcheck", "//pkg/cloud/cloudpb", @@ -221,7 +220,6 @@ go_test( "//pkg/base", "//pkg/blobs", "//pkg/build/bazel", - "//pkg/ccl", "//pkg/ccl/kvccl", "//pkg/ccl/multiregionccl", "//pkg/ccl/multiregionccl/multiregionccltestutils", diff --git a/pkg/backup/alter_backup_schedule.go b/pkg/backup/alter_backup_schedule.go index bbdf05b73d95..3fb151bf7265 100644 --- a/pkg/backup/alter_backup_schedule.go +++ b/pkg/backup/alter_backup_schedule.go @@ -10,7 +10,6 @@ import ( "strconv" "github.com/cockroachdb/cockroach/pkg/backup/backuppb" - "github.com/cockroachdb/cockroach/pkg/ccl/utilccl" "github.com/cockroachdb/cockroach/pkg/jobs" "github.com/cockroachdb/cockroach/pkg/jobs/jobspb" "github.com/cockroachdb/cockroach/pkg/scheduledjobs/schedulebase" @@ -144,7 +143,6 @@ func doAlterBackupSchedules( p, spec.fullBackupAlways, spec.fullBackupRecurrence, - spec.isEnterpriseUser, s, ); err != nil { return err @@ -418,7 +416,6 @@ func processFullBackupRecurrence( p sql.PlanHookState, fullBackupAlways bool, fullBackupRecurrence string, - isEnterpriseUser bool, s scheduleDetails, ) (scheduleDetails, error) { var err error @@ -449,12 +446,6 @@ func processFullBackupRecurrence( return s, nil } - // We have FULL BACKUP . - if !isEnterpriseUser { - return scheduleDetails{}, errors.Newf("Enterprise license required to use incremental backups. " + - "To modify the cadence of a full backup, use the 'RECURRING ' clause instead.") - } - if s.incJob == nil { // No existing incremental job, so we need to create it, copying details // from the full. @@ -628,7 +619,6 @@ type alterBackupScheduleSpec struct { recurrence string fullBackupRecurrence string fullBackupAlways bool - isEnterpriseUser bool label string into []string backupOptions tree.BackupOptions @@ -712,11 +702,6 @@ func makeAlterBackupScheduleSpec( return nil, err } - enterpriseCheckErr := utilccl.CheckEnterpriseEnabled( - p.ExecCfg().Settings, - "BACKUP INTO LATEST") - spec.isEnterpriseUser = enterpriseCheckErr == nil - return spec, nil } diff --git a/pkg/backup/backup_intents_test.go b/pkg/backup/backup_intents_test.go index 07e6566a95a0..d20e3845fc8c 100644 --- a/pkg/backup/backup_intents_test.go +++ b/pkg/backup/backup_intents_test.go @@ -13,7 +13,6 @@ import ( "testing" "github.com/cockroachdb/cockroach/pkg/base" - "github.com/cockroachdb/cockroach/pkg/ccl" "github.com/cockroachdb/cockroach/pkg/kv/kvpb" "github.com/cockroachdb/cockroach/pkg/kv/kvserver" "github.com/cockroachdb/cockroach/pkg/testutils" @@ -29,7 +28,6 @@ import ( func TestCleanupIntentsDuringBackupPerformanceRegression(t *testing.T) { defer leaktest.AfterTest(t)() defer log.Scope(t).Close(t) - defer ccl.TestingEnableEnterprise()() skip.UnderRace(t, "measures backup times to ensure intent resolution does not regress, can't work under race") skip.UnderDeadlock(t, "measures backup times to ensure intent resolution does not regress, can't work under deadlock") diff --git a/pkg/backup/backup_job.go b/pkg/backup/backup_job.go index 7475166d4577..33ed5c659947 100644 --- a/pkg/backup/backup_job.go +++ b/pkg/backup/backup_job.go @@ -25,7 +25,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/backup/backuputils" "github.com/cockroachdb/cockroach/pkg/build" "github.com/cockroachdb/cockroach/pkg/ccl/kvccl/kvfollowerreadsccl" - "github.com/cockroachdb/cockroach/pkg/ccl/utilccl" "github.com/cockroachdb/cockroach/pkg/cloud" "github.com/cockroachdb/cockroach/pkg/cloud/cloudpb" "github.com/cockroachdb/cockroach/pkg/clusterversion" @@ -773,10 +772,7 @@ func (b *backupResumer) Resume(ctx context.Context, execCtx interface{}) error { } // Collect telemetry, once per backup after resolving its destination. - lic := utilccl.CheckEnterpriseEnabled( - p.ExecCfg().Settings, "", - ) != nil - collectTelemetry(ctx, backupManifest, initialDetails, details, lic, b.job.ID()) + collectTelemetry(ctx, backupManifest, initialDetails, details, true, b.job.ID()) } // For all backups, partitioned or not, the main BACKUP manifest is stored at @@ -1795,9 +1791,6 @@ func getBackupDetailAndManifest( return jobspb.BackupDetails{}, backuppb.BackupManifest{}, errors.Errorf("cannot append a backup of specific tables or databases to a cluster backup") } - if err := requireEnterprise(execCfg, "incremental"); err != nil { - return jobspb.BackupDetails{}, backuppb.BackupManifest{}, err - } lastEndTime := prevBackups[len(prevBackups)-1].EndTime if lastEndTime.Compare(initialDetails.EndTime) > 0 { return jobspb.BackupDetails{}, backuppb.BackupManifest{}, diff --git a/pkg/backup/backup_planning.go b/pkg/backup/backup_planning.go index b417d0aa52f4..47fb80545985 100644 --- a/pkg/backup/backup_planning.go +++ b/pkg/backup/backup_planning.go @@ -13,7 +13,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/backup/backupbase" "github.com/cockroachdb/cockroach/pkg/backup/backupresolver" - "github.com/cockroachdb/cockroach/pkg/ccl/utilccl" "github.com/cockroachdb/cockroach/pkg/cloud" "github.com/cockroachdb/cockroach/pkg/cloud/cloudprivilege" "github.com/cockroachdb/cockroach/pkg/featureflag" @@ -366,16 +365,6 @@ func checkPrivilegesForBackup( return cloudprivilege.CheckDestinationPrivileges(ctx, p, to) } -func requireEnterprise(execCfg *sql.ExecutorConfig, feature string) error { - if err := utilccl.CheckEnterpriseEnabled( - execCfg.Settings, - fmt.Sprintf("BACKUP with %s", feature), - ); err != nil { - return err - } - return nil -} - func backupTypeCheck( ctx context.Context, stmt tree.Statement, p sql.PlanHookState, ) (matched bool, header colinfo.ResultColumns, _ error) { @@ -536,12 +525,6 @@ func backupPlanHook( return errors.Errorf("BACKUP cannot be used inside a multi-statement transaction without DETACHED option") } - if len(to) > 1 { - if err := requireEnterprise(p.ExecCfg(), "partitioned destinations"); err != nil { - return err - } - } - if len(incrementalStorage) > 0 && (len(incrementalStorage) != len(to)) { return errors.New("the incremental_location option must contain the same number of locality" + " aware URIs as the full backup destination") @@ -564,27 +547,9 @@ func backupPlanHook( switch encryptionParams.Mode { case jobspb.EncryptionMode_Passphrase: - if err := requireEnterprise(p.ExecCfg(), "encryption"); err != nil { - return err - } encryptionParams.RawPassphrase = pw case jobspb.EncryptionMode_KMS: encryptionParams.RawKmsUris = kms - if err := requireEnterprise(p.ExecCfg(), "encryption"); err != nil { - return err - } - } - - if revisionHistory { - if err := requireEnterprise(p.ExecCfg(), "revision_history"); err != nil { - return err - } - } - - if executionLocality.NonEmpty() { - if err := requireEnterprise(p.ExecCfg(), "execution locality"); err != nil { - return err - } } var targetDescs []catalog.Descriptor diff --git a/pkg/backup/backupresolver/BUILD.bazel b/pkg/backup/backupresolver/BUILD.bazel index 90448d3b7ac8..6c121db4748f 100644 --- a/pkg/backup/backupresolver/BUILD.bazel +++ b/pkg/backup/backupresolver/BUILD.bazel @@ -31,7 +31,6 @@ go_test( ], embed = [":backupresolver"], deps = [ - "//pkg/ccl", "//pkg/ccl/storageccl", "//pkg/keys", "//pkg/security/securityassets", diff --git a/pkg/backup/backupresolver/main_test.go b/pkg/backup/backupresolver/main_test.go index 6a41866250a2..e6c29fb8987c 100644 --- a/pkg/backup/backupresolver/main_test.go +++ b/pkg/backup/backupresolver/main_test.go @@ -9,7 +9,6 @@ import ( "os" "testing" - "github.com/cockroachdb/cockroach/pkg/ccl" _ "github.com/cockroachdb/cockroach/pkg/ccl/storageccl" "github.com/cockroachdb/cockroach/pkg/security/securityassets" "github.com/cockroachdb/cockroach/pkg/security/securitytest" @@ -20,7 +19,6 @@ import ( ) func TestMain(m *testing.M) { - defer ccl.TestingEnableEnterprise()() securityassets.SetLoader(securitytest.EmbeddedAssets) randutil.SeedForTests() serverutils.InitTestServerFactory(server.TestServerFactory) diff --git a/pkg/backup/create_scheduled_backup.go b/pkg/backup/create_scheduled_backup.go index 94b50708acf0..f07749dc83d8 100644 --- a/pkg/backup/create_scheduled_backup.go +++ b/pkg/backup/create_scheduled_backup.go @@ -12,7 +12,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/backup/backupdest" "github.com/cockroachdb/cockroach/pkg/backup/backuppb" - "github.com/cockroachdb/cockroach/pkg/ccl/utilccl" "github.com/cockroachdb/cockroach/pkg/cloud" "github.com/cockroachdb/cockroach/pkg/clusterversion" "github.com/cockroachdb/cockroach/pkg/jobs" @@ -70,8 +69,6 @@ var scheduledBackupGCProtectionEnabled = settings.RegisterBoolSetting( type scheduledBackupSpec struct { *tree.ScheduledBackup - isEnterpriseUser bool - // Schedule specific properties that get evaluated. scheduleLabel *string recurrence *string @@ -379,7 +376,7 @@ func doCreateBackupSchedules( if firstRun != nil { full.SetNextRun(*firstRun) - } else if eval.isEnterpriseUser && fullRecurrencePicked { + } else if fullRecurrencePicked { // The enterprise user did not indicate preference when to run full backups, // and we picked the schedule ourselves. // Run full backup immediately so that we do not wind up waiting for a long @@ -623,12 +620,7 @@ func makeScheduledBackupSpec( spec.recurrence = &rec } - enterpriseCheckErr := utilccl.CheckEnterpriseEnabled( - p.ExecCfg().Settings, - "BACKUP INTO LATEST") - spec.isEnterpriseUser = enterpriseCheckErr == nil - - if spec.isEnterpriseUser && schedule.FullBackup != nil { + if schedule.FullBackup != nil { if schedule.FullBackup.AlwaysFull { spec.fullBackupRecurrence = spec.recurrence spec.recurrence = nil @@ -639,21 +631,6 @@ func makeScheduledBackupSpec( } spec.fullBackupRecurrence = &rec } - } else if !spec.isEnterpriseUser { - if schedule.FullBackup == nil || schedule.FullBackup.AlwaysFull { - // All backups are full cluster backups for free users. - spec.fullBackupRecurrence = spec.recurrence - spec.recurrence = nil - if schedule.FullBackup == nil { - p.BufferClientNotice(ctx, - pgnotice.Newf("Without an enterprise license,"+ - " this schedule will only run full backups. To mute this notice, "+ - "add the 'FULL BACKUP ALWAYS' clause to your CREATE SCHEDULE command.")) - } - } else { - // Cannot use incremental backup w/out enterprise license. - return nil, enterpriseCheckErr - } } spec.scheduleOpts, err = exprEval.KVOptions( diff --git a/pkg/backup/main_test.go b/pkg/backup/main_test.go index b6cab4ed0569..00198f5e00e8 100644 --- a/pkg/backup/main_test.go +++ b/pkg/backup/main_test.go @@ -9,7 +9,6 @@ import ( "os" "testing" - "github.com/cockroachdb/cockroach/pkg/ccl" _ "github.com/cockroachdb/cockroach/pkg/ccl/storageccl" "github.com/cockroachdb/cockroach/pkg/security/securityassets" "github.com/cockroachdb/cockroach/pkg/security/securitytest" @@ -20,7 +19,6 @@ import ( ) func TestMain(m *testing.M) { - defer ccl.TestingEnableEnterprise()() securityassets.SetLoader(securitytest.EmbeddedAssets) randutil.SeedForTests() serverutils.InitTestServerFactory(server.TestServerFactory)