Skip to content

Commit

Permalink
Merge #134215
Browse files Browse the repository at this point in the history
134215: roachtest: fix bad restore paths in roachtests r=yuzefovich a=kev-cao

Changes introduced in #133296 updated restore syntax to the FROM/IN syntax, but as the restores were from backups made using the old BACKUP TO syntax, the restore paths are incorrect. This updates the paths to match the backup directories.

Fixes: #133791

Epic: none

Release note: none

Co-authored-by: Kevin Cao <[email protected]>
  • Loading branch information
craig[bot] and kev-cao committed Nov 4, 2024
2 parents fd08f85 + 9231dc4 commit cb4cc3a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/cmd/roachtest/tests/sqlsmith.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func registerSQLSmith(r registry.Registry) {
sqlsmith.RandTableSetupName: sqlsmith.Setups[sqlsmith.RandTableSetupName],
"tpch-sf1": func(r *rand.Rand) []string {
return []string{`
RESTORE TABLE tpch.* FROM LATEST IN 'gs://cockroach-fixtures-us-east1/workload/tpch/scalefactor=1/backup?AUTH=implicit'
RESTORE TABLE tpch.* FROM '/' IN 'gs://cockroach-fixtures-us-east1/workload/tpch/scalefactor=1/backup?AUTH=implicit'
WITH into_db = 'defaultdb', unsafe_restore_incompatible_version;
`}
},
Expand All @@ -56,7 +56,7 @@ WITH into_db = 'defaultdb', unsafe_restore_incompatible_version;
stmts = append(
stmts,
fmt.Sprintf(`
RESTORE TABLE tpcc.%s FROM LATEST IN 'gs://cockroach-fixtures-us-east1/workload/tpcc/%[2]s/%[1]s?AUTH=implicit'
RESTORE TABLE tpcc.%s FROM '/' IN 'gs://cockroach-fixtures-us-east1/workload/tpcc/%[2]s/%[1]s?AUTH=implicit'
WITH into_db = 'defaultdb', unsafe_restore_incompatible_version;
`,
t, version,
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/roachtest/tests/tpc_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func loadTPCHDataset(
if _, err := db.ExecContext(ctx, `CREATE DATABASE IF NOT EXISTS tpch;`); err != nil {
return err
}
query := fmt.Sprintf(`RESTORE tpch.* FROM LATEST IN '%s' WITH into_db = 'tpch', unsafe_restore_incompatible_version;`, tpchURL)
query := fmt.Sprintf(`RESTORE tpch.* FROM '/' IN '%s' WITH into_db = 'tpch', unsafe_restore_incompatible_version;`, tpchURL)
_, err = db.ExecContext(ctx, query)
return err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/roachtest/tests/tpcdsvec.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func registerTPCDSVec(r registry.Registry) {
t.Status("restoring TPCDS dataset for Scale Factor 1")
if _, err := clusterConn.Exec(
`
RESTORE DATABASE tpcds FROM LATEST IN 'gs://cockroach-fixtures-us-east1/workload/tpcds/scalefactor=1/backup?AUTH=implicit'
RESTORE DATABASE tpcds FROM '/' IN 'gs://cockroach-fixtures-us-east1/workload/tpcds/scalefactor=1/backup?AUTH=implicit'
WITH unsafe_restore_incompatible_version;
`,
); err != nil {
Expand Down

0 comments on commit cb4cc3a

Please sign in to comment.