Skip to content

Commit

Permalink
roachtest: add elastic backup equivalent test for aws
Browse files Browse the repository at this point in the history
Informs cockroachdb#107770.

Release note: None
  • Loading branch information
aadityasondhi committed Jan 18, 2024
1 parent 6e499de commit 28404de
Showing 1 changed file with 31 additions and 12 deletions.
43 changes: 31 additions & 12 deletions pkg/cmd/roachtest/tests/admission_control_elastic_backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,8 @@ import (
// which {CPU-scheduler,foreground} latencies are protected and track this data
// in roachperf.
func registerElasticControlForBackups(r registry.Registry) {
r.Add(registry.TestSpec{
Name: "admission-control/elastic-backup",
Owner: registry.OwnerAdmissionControl,
Benchmark: true,
CompatibleClouds: registry.AllExceptAWS,
Suites: registry.Suites(registry.Weekly),
Cluster: r.MakeClusterSpec(4, spec.CPU(8)),
Leases: registry.MetamorphicLeases,
Run: func(ctx context.Context, t test.Test, c cluster.Cluster) {
run := func(cloud string) func(ctx context.Context, t test.Test, c cluster.Cluster) {
return func(ctx context.Context, t test.Test, c cluster.Cluster) {
if c.Spec().NodeCount < 4 {
t.Fatalf("expected at least 4 nodes, found %d", c.Spec().NodeCount)
}
Expand Down Expand Up @@ -83,6 +76,7 @@ func registerElasticControlForBackups(r registry.Registry) {
EstimatedSetupTime: estimatedSetupTime,
SkipPostRunCheck: true,
ExtraSetupArgs: "--checks=false",
ExtraRunArgs: "--tolerate-errors",
PrometheusConfig: promCfg,
DisableDefaultScheduledBackup: true,
During: func(ctx context.Context) error {
Expand All @@ -95,10 +89,13 @@ func registerElasticControlForBackups(r registry.Registry) {
m := c.NewMonitor(ctx, c.Range(1, crdbNodes))
m.Go(func(ctx context.Context) error {
t.Status(fmt.Sprintf("during: creating full backup schedule to run every 20m (<%s)", time.Minute))
gcsBackupTestingBucket := backupTestingBucket
bucketPrefix := "gs"
if cloud == "aws" {
bucketPrefix = "s3"
}
_, err := db.ExecContext(ctx,
`CREATE SCHEDULE FOR BACKUP INTO $1 RECURRING '*/20 * * * *' FULL BACKUP ALWAYS WITH SCHEDULE OPTIONS ignore_existing_backups;`,
"gs://"+gcsBackupTestingBucket+"/"+c.Name()+"?AUTH=implicit",
bucketPrefix+"://"+backupTestingBucket+"/"+c.Name()+"?AUTH=implicit",
)
return err
})
Expand All @@ -108,6 +105,28 @@ func registerElasticControlForBackups(r registry.Registry) {
return nil
},
})
},
}
}

r.Add(registry.TestSpec{
Name: "admission-control/elastic-backup",
Owner: registry.OwnerAdmissionControl,
Benchmark: true,
Suites: registry.Suites(`weekly`),
Cluster: r.MakeClusterSpec(4, spec.CPU(8)),
CompatibleClouds: registry.OnlyGCE,
Leases: registry.MetamorphicLeases,
Run: run("gce"),
})

r.Add(registry.TestSpec{
Name: "admission-control/elastic-backup-s3",
Owner: registry.OwnerAdmissionControl,
Benchmark: true,
Suites: registry.Suites(`weekly`),
Cluster: r.MakeClusterSpec(4, spec.CPU(8)),
CompatibleClouds: registry.OnlyAWS,
Leases: registry.MetamorphicLeases,
Run: run("aws"),
})
}

0 comments on commit 28404de

Please sign in to comment.