Skip to content

Commit 36442e9

Browse files
committed
roachtest: deflake online restore recovery roachtest
The online restore recovery roachtest would very occasionally flake due to it detecting the download job having succeeded. It turns out that the download job was not succeeding, but to find the job, we match on the description containing "Background Data Download", which the GC job that runs to cleanup after download contains. So if the download job failed fast enough, the query to find the download job would match on the GC job instead. This patch updates the query to only look for restore jobs instead. Fixes: #151973 Release note: None
1 parent dbdfb73 commit 36442e9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pkg/cmd/roachtest/tests/mixed_version_backup.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2673,7 +2673,13 @@ func (d BackupRestoreTestDriver) getORDownloadJobID(
26732673
ctx context.Context, l *logger.Logger, rng *rand.Rand,
26742674
) (int, error) {
26752675
var downloadJobID int
2676-
if err := d.testUtils.QueryRow(ctx, rng, `SELECT job_id FROM [SHOW JOBS] WHERE description LIKE '%Background Data Download%' ORDER BY created DESC LIMIT 1`).Scan(&downloadJobID); err != nil {
2676+
if err := d.testUtils.QueryRow(
2677+
ctx,
2678+
rng,
2679+
`SELECT job_id FROM [SHOW JOBS]
2680+
WHERE description LIKE '%Background Data Download%' AND job_type = 'RESTORE'
2681+
ORDER BY created DESC LIMIT 1`,
2682+
).Scan(&downloadJobID); err != nil {
26772683
return 0, err
26782684
}
26792685
return downloadJobID, nil

0 commit comments

Comments
 (0)