diff --git a/pkg/ccl/backupccl/backup_test.go b/pkg/ccl/backupccl/backup_test.go index 2ff9840f5d1d..dbc0681e8e6e 100644 --- a/pkg/ccl/backupccl/backup_test.go +++ b/pkg/ccl/backupccl/backup_test.go @@ -659,15 +659,18 @@ func TestBackupRestoreAppend(t *testing.T) { sqlDB.ExpectErr(t, "A full backup cannot be written to \"/subdir\", a user defined subdirectory", "BACKUP INTO $4 IN ($1, $2, $3) AS OF SYSTEM TIME "+tsBefore, append(test.collectionsWithSubdir, specifiedSubdir)...) - sqlDB.QueryRow(t, "UPDATE data.bank SET balance = 100 RETURNING cluster_logical_timestamp()").Scan(&ts1) + sqlDB.RunWithRetriableTxn(t, func(txn *gosql.Tx) error { + return txn.QueryRow("UPDATE data.bank SET balance = 100 RETURNING cluster_logical_timestamp()").Scan(&ts1) + }) sqlDB.Exec(t, "BACKUP INTO LATEST IN ($1, $2, $3) AS OF SYSTEM TIME "+ts1, test.collections...) // Append to latest again, just to prove we can append to an appended one and // that appended didn't e.g. mess up LATEST. sqlDB.QueryRow(t, "SELECT cluster_logical_timestamp()").Scan(&ts1again) sqlDB.Exec(t, "BACKUP INTO LATEST IN ($1, $2, $3) AS OF SYSTEM TIME "+ts1again, test.collections...) - - sqlDB.QueryRow(t, "UPDATE data.bank SET balance = 200 RETURNING cluster_logical_timestamp()").Scan(&ts2) + sqlDB.RunWithRetriableTxn(t, func(txn *gosql.Tx) error { + return txn.QueryRow("UPDATE data.bank SET balance = 200 RETURNING cluster_logical_timestamp()").Scan(&ts2) + }) rowsTS2 := sqlDB.QueryStr(t, "SELECT * from data.bank ORDER BY id") // Start a new full-backup in the collection version.