diff --git a/pkg/ccl/backupccl/restore_old_versions_test.go b/pkg/ccl/backupccl/restore_old_versions_test.go index a5472e88bbf2..fa9d71672948 100644 --- a/pkg/ccl/backupccl/restore_old_versions_test.go +++ b/pkg/ccl/backupccl/restore_old_versions_test.go @@ -21,7 +21,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/jobs" "github.com/cockroachdb/cockroach/pkg/jobs/jobspb" "github.com/cockroachdb/cockroach/pkg/keys" - "github.com/cockroachdb/cockroach/pkg/roachpb" "github.com/cockroachdb/cockroach/pkg/server" "github.com/cockroachdb/cockroach/pkg/sql" "github.com/cockroachdb/cockroach/pkg/sql/catalog" @@ -68,7 +67,6 @@ func TestRestoreOldVersions(t *testing.T) { var ( exportDirsWithoutInterleave = testdataBase + "/exports-without-interleaved" clusterDirs = testdataBase + "/cluster" - multiRegionDirs = testdataBase + "/multi-region" publicSchemaDirs = testdataBase + "/public-schema-remap" systemUsersDirs = testdataBase + "/system-users-restore" systemRoleMembersDirs = testdataBase + "/system-role-members-restore" @@ -97,18 +95,6 @@ func TestRestoreOldVersions(t *testing.T) { } }) - t.Run("multi-region-restore", func(t *testing.T) { - skip.UnderRace(t, "very slow as it starts multiple servers") - dirs, err := os.ReadDir(multiRegionDirs) - require.NoError(t, err) - for _, dir := range dirs { - require.True(t, dir.IsDir()) - exportDir, err := filepath.Abs(filepath.Join(multiRegionDirs, dir.Name())) - require.NoError(t, err) - t.Run(dir.Name(), runOldVersionMultiRegionTest(exportDir)) - } - }) - t.Run("public_schema_remap", func(t *testing.T) { dirs, err := os.ReadDir(publicSchemaDirs) require.NoError(t, err) @@ -165,89 +151,6 @@ func TestRestoreOldVersions(t *testing.T) { }) } -func runOldVersionMultiRegionTest(exportDir string) func(t *testing.T) { - return func(t *testing.T) { - const numNodes = 9 - dir, dirCleanupFn := testutils.TempDir(t) - defer dirCleanupFn() - ctx := context.Background() - - params := make(map[int]base.TestServerArgs, numNodes) - for i := 0; i < 9; i++ { - var region string - switch i / 3 { - case 0: - region = "europe-west2" - case 1: - region = "us-east1" - case 2: - region = "us-west1" - } - params[i] = base.TestServerArgs{ - // Test fails due to inability to use multi-region - // abstractions by default in tenants. Tracked with #76378. - DisableDefaultTestTenant: true, - Locality: roachpb.Locality{ - Tiers: []roachpb.Tier{ - {Key: "region", Value: region}, - }, - }, - ExternalIODir: dir, - } - } - - tc := testcluster.StartTestCluster(t, numNodes, base.TestClusterArgs{ - ServerArgsPerNode: params, - }) - defer tc.Stopper().Stop(ctx) - require.NoError(t, os.Symlink(exportDir, filepath.Join(dir, "external_backup_dir"))) - - sqlDB := sqlutils.MakeSQLRunner(tc.Conns[0]) - - var unused string - var importedRows int - sqlDB.QueryRow(t, `RESTORE DATABASE multi_region_db FROM $1`, `nodelocal://0/external_backup_dir`).Scan( - &unused, &unused, &unused, &importedRows, &unused, &unused, - ) - const totalRows = 12 - if importedRows != totalRows { - t.Fatalf("expected %d rows, got %d", totalRows, importedRows) - } - sqlDB.Exec(t, `USE multi_region_db`) - sqlDB.CheckQueryResults(t, `select table_name, locality FROM [show tables] ORDER BY table_name;`, [][]string{ - {`tbl_global`, `GLOBAL`}, - {`tbl_primary_region`, `REGIONAL BY TABLE IN PRIMARY REGION`}, - {`tbl_regional_by_row`, `REGIONAL BY ROW`}, - {`tbl_regional_by_table`, `REGIONAL BY TABLE IN "us-east1"`}, - }) - sqlDB.CheckQueryResults(t, `SELECT region FROM [SHOW REGIONS FROM DATABASE] ORDER BY region`, [][]string{ - {`europe-west2`}, - {`us-east1`}, - {`us-west1`}, - }) - sqlDB.CheckQueryResults(t, `SELECT * FROM tbl_primary_region ORDER BY pk`, [][]string{ - {`1`, `a`}, - {`2`, `b`}, - {`3`, `c`}, - }) - sqlDB.CheckQueryResults(t, `SELECT * FROM tbl_global ORDER BY pk`, [][]string{ - {`4`, `d`}, - {`5`, `e`}, - {`6`, `f`}, - }) - sqlDB.CheckQueryResults(t, `SELECT * FROM tbl_regional_by_table ORDER BY pk`, [][]string{ - {`7`, `g`}, - {`8`, `h`}, - {`9`, `i`}, - }) - sqlDB.CheckQueryResults(t, `SELECT crdb_region, * FROM tbl_regional_by_row ORDER BY pk`, [][]string{ - {`europe-west2`, `10`, `j`}, - {`us-east1`, `11`, `k`}, - {`us-west1`, `12`, `l`}, - }) - } -} - func restoreOldVersionTest(exportDir string) func(t *testing.T) { return func(t *testing.T) { params := base.TestServerArgs{} diff --git a/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/BACKUP-CHECKPOINT-689695912042364929-CHECKSUM b/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/BACKUP-CHECKPOINT-689695912042364929-CHECKSUM deleted file mode 100644 index 2b52304996c3..000000000000 --- a/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/BACKUP-CHECKPOINT-689695912042364929-CHECKSUM +++ /dev/null @@ -1 +0,0 @@ -Úª½ \ No newline at end of file diff --git a/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/BACKUP-CHECKPOINT-CHECKSUM b/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/BACKUP-CHECKPOINT-CHECKSUM deleted file mode 100644 index 2b52304996c3..000000000000 --- a/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/BACKUP-CHECKPOINT-CHECKSUM +++ /dev/null @@ -1 +0,0 @@ -Úª½ \ No newline at end of file diff --git a/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/BACKUP-STATISTICS b/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/BACKUP-STATISTICS deleted file mode 100644 index 0541731d99a2..000000000000 Binary files a/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/BACKUP-STATISTICS and /dev/null differ diff --git a/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/BACKUP_MANIFEST b/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/BACKUP_MANIFEST deleted file mode 100644 index 4da346495dc4..000000000000 Binary files a/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/BACKUP_MANIFEST and /dev/null differ diff --git a/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/BACKUP_MANIFEST-CHECKSUM b/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/BACKUP_MANIFEST-CHECKSUM deleted file mode 100644 index a43745d920cc..000000000000 --- a/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/BACKUP_MANIFEST-CHECKSUM +++ /dev/null @@ -1 +0,0 @@ -VÑf³ \ No newline at end of file diff --git a/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/data/689695934306746371.sst b/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/data/689695934306746371.sst deleted file mode 100644 index 2519dda27920..000000000000 Binary files a/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/data/689695934306746371.sst and /dev/null differ diff --git a/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/data/689695934419206148.sst b/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/data/689695934419206148.sst deleted file mode 100644 index aa7d71f2a6ad..000000000000 Binary files a/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/data/689695934419206148.sst and /dev/null differ diff --git a/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/data/689695934447878153.sst b/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/data/689695934447878153.sst deleted file mode 100644 index b47a9929ceca..000000000000 Binary files a/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/data/689695934447878153.sst and /dev/null differ diff --git a/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/data/689695934447910921.sst b/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/data/689695934447910921.sst deleted file mode 100644 index 6f6953239341..000000000000 Binary files a/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/data/689695934447910921.sst and /dev/null differ diff --git a/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/data/689695934449156104.sst b/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/data/689695934449156104.sst deleted file mode 100644 index 6ac5e0a63943..000000000000 Binary files a/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/data/689695934449156104.sst and /dev/null differ diff --git a/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/data/689695934449188872.sst b/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/data/689695934449188872.sst deleted file mode 100644 index c875d79c0ec5..000000000000 Binary files a/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/data/689695934449188872.sst and /dev/null differ diff --git a/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/data/689695934450302983.sst b/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/data/689695934450302983.sst deleted file mode 100644 index 94af30b28f44..000000000000 Binary files a/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/data/689695934450302983.sst and /dev/null differ diff --git a/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/data/689695934450434056.sst b/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/data/689695934450434056.sst deleted file mode 100644 index bedd4652be3e..000000000000 Binary files a/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/data/689695934450434056.sst and /dev/null differ diff --git a/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/data/689695934450565127.sst b/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/data/689695934450565127.sst deleted file mode 100644 index 3fac1e95722c..000000000000 Binary files a/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/data/689695934450565127.sst and /dev/null differ diff --git a/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/data/689695934593073153.sst b/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/data/689695934593073153.sst deleted file mode 100644 index 2e403faeb8b2..000000000000 Binary files a/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/data/689695934593073153.sst and /dev/null differ diff --git a/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/data/689695934593105921.sst b/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/data/689695934593105921.sst deleted file mode 100644 index 260ddac94630..000000000000 Binary files a/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/data/689695934593105921.sst and /dev/null differ diff --git a/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/data/689695934739775496.sst b/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/data/689695934739775496.sst deleted file mode 100644 index b8cae221fa60..000000000000 Binary files a/pkg/ccl/backupccl/testdata/restore_old_versions/multi-region/v21.1/data/689695934739775496.sst and /dev/null differ