Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
86941: backupccl: missing txn in restore planning r=stevendanna a=adityamaru

We were not passing in the DescsTxn when dropping defaultdb
and postgres during restore planning. This manifested itself
as a hung test where the drop defaultdb was waiting for the lease
on the database to expire.

Release note: None

Release justification: low risk bug fix

Co-authored-by: adityamaru <[email protected]>
  • Loading branch information
craig[bot] and adityamaru committed Aug 26, 2022
2 parents aa4f001 + 0b5a6d1 commit 8c84c34
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/ccl/backupccl/restore_planning.go
Original file line number Diff line number Diff line change
Expand Up @@ -653,12 +653,12 @@ func getDatabaseIDAndDesc(
func dropDefaultUserDBs(ctx context.Context, execCfg *sql.ExecutorConfig) error {
return sql.DescsTxn(ctx, execCfg, func(ctx context.Context, txn *kv.Txn, col *descs.Collection) error {
ie := execCfg.InternalExecutor
_, err := ie.Exec(ctx, "drop-defaultdb", nil, "DROP DATABASE IF EXISTS defaultdb")
_, err := ie.Exec(ctx, "drop-defaultdb", txn, "DROP DATABASE IF EXISTS defaultdb")
if err != nil {
return err
}

_, err = ie.Exec(ctx, "drop-postgres", nil, "DROP DATABASE IF EXISTS postgres")
_, err = ie.Exec(ctx, "drop-postgres", txn, "DROP DATABASE IF EXISTS postgres")
if err != nil {
return err
}
Expand Down

0 comments on commit 8c84c34

Please sign in to comment.