Skip to content

Commit

Permalink
Merge pull request #6760 from dolthub/aaron/backup-dropped-error-SetRoot
Browse files Browse the repository at this point in the history
dolt backup: Fix dropped error on the final stage of updating the destination with the newly pushed backup.
  • Loading branch information
reltuk authored Oct 2, 2023
2 parents 44abb30 + 0e44fff commit a9c7808
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion go/libraries/doltcore/env/actions/remotes.go
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,22 @@ func SyncRoots(ctx context.Context, srcDb, destDb *doltdb.DoltDB, tempTableDir s
return err
}

destDb.CommitRoot(ctx, srcRoot, destRoot)
var numRetries int
var success bool
for err == nil && !success && numRetries < 10 {
success, err = destDb.CommitRoot(ctx, srcRoot, destRoot)
if err == nil && !success {
destRoot, err = destDb.NomsRoot(ctx)
numRetries += 1
}
}
if err != nil {
return err
}

if !success {
return errors.New("could not set destination root to the same value as this database's root. the destination database received too many writes while we were pushing and we exhausted our retries.")
}

return nil
}
Expand Down

0 comments on commit a9c7808

Please sign in to comment.