Skip to content

Commit

Permalink
wip - remove retry logic
Browse files Browse the repository at this point in the history
Signed-off-by: Florent Poinsard <[email protected]>
  • Loading branch information
frouioui committed Jan 21, 2025
1 parent 93d6c52 commit 17e06ec
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions go/cmd/vtbackup/cli/vtbackup.go
Original file line number Diff line number Diff line change
Expand Up @@ -537,12 +537,12 @@ func takeBackup(ctx, backgroundCtx context.Context, topoServer *topo.Server, bac

waitStartTime = time.Now()

continuousErrorCount int
// continuousErrorCount int
)
for {
if continuousErrorCount == maximumErrorCountWhenWaitingForReplicationStatus {
return fmt.Errorf("timeout waiting for replication status after %d errors", maximumErrorCountWhenWaitingForReplicationStatus)
}
// if continuousErrorCount == maximumErrorCountWhenWaitingForReplicationStatus {
// return fmt.Errorf("timeout waiting for replication status after %d errors", maximumErrorCountWhenWaitingForReplicationStatus)
// }

select {
case <-ctx.Done():
Expand All @@ -554,7 +554,7 @@ func takeBackup(ctx, backgroundCtx context.Context, topoServer *topo.Server, bac
status, statusErr = mysqld.ReplicationStatus(ctx)
if statusErr != nil {
log.Warningf("Error getting replication status: %v", statusErr)
continuousErrorCount++
// continuousErrorCount++
continue
}
if status.Position.AtLeast(primaryPos) {
Expand All @@ -577,11 +577,11 @@ func takeBackup(ctx, backgroundCtx context.Context, topoServer *topo.Server, bac
if err := startReplication(ctx, mysqld, topoServer); err != nil {
log.Warningf("Failed to restart replication: %v", err)
}
continuousErrorCount++
// continuousErrorCount++
} else {
// Since replication is working if we got here, let's reset the error count to zero.
// This allows us to avoid failing if we only have transient errors from time to time.
continuousErrorCount = 0
// continuousErrorCount = 0
phaseStatus.Set([]string{phaseNameCatchupReplication, phaseStatusCatchupReplicationStopped}, 0)
}
}
Expand Down

0 comments on commit 17e06ec

Please sign in to comment.