Skip to content

Commit

Permalink
br: revert "Add retry limit of connection err in fine grained backup" (
Browse files Browse the repository at this point in the history
  • Loading branch information
RidRisR authored Dec 24, 2024
1 parent a878e1f commit 80db670
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 84 deletions.
27 changes: 4 additions & 23 deletions br/pkg/backup/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ const (
// We need to be more patient.
backupFineGrainedMaxBackoff = 3600000
backupRetryTimes = 5
disconnectRetryTimeout = 20000
// RangeUnit represents the progress updated counter when a range finished.
RangeUnit ProgressUnit = "range"
// RegionUnit represents the progress updated counter when a region finished.
Expand Down Expand Up @@ -1159,7 +1158,6 @@ func (bc *Client) fineGrainedBackup(
})

bo := utils.AdaptTiKVBackoffer(ctx, backupFineGrainedMaxBackoff, berrors.ErrUnknown)
maxDisconnect := make(map[uint64]uint)
for {
// Step1, check whether there is any incomplete range
incomplete := pr.Res.GetIncompleteRange(req.StartKey, req.EndKey)
Expand Down Expand Up @@ -1207,19 +1205,8 @@ func (bc *Client) fineGrainedBackup(
for {
select {
case err := <-errCh:
if !berrors.Is(err, berrors.ErrFailedToConnect) {
return errors.Trace(err)
}
storeErr, ok := err.(*StoreBasedErr)
if !ok {
return errors.Trace(err)
}

storeID := storeErr.storeID
maxDisconnect[storeID]++
if maxDisconnect[storeID] > backupRetryTimes {
return errors.Annotatef(err, "Failed to connect to store %d more than %d times", storeID, backupRetryTimes)
}
// TODO: should we handle err here?
return errors.Trace(err)
case resp, ok := <-respCh:
if !ok {
// Finished.
Expand Down Expand Up @@ -1332,10 +1319,7 @@ func (bc *Client) handleFineGrained(
// When the leader store is died,
// 20s for the default max duration before the raft election timer fires.
logutil.CL(ctx).Warn("failed to connect to store, skipping", logutil.ShortError(err), zap.Uint64("storeID", storeID))
return disconnectRetryTimeout, &StoreBasedErr{
storeID: storeID,
err: err,
}
return 20000, nil
}

logutil.CL(ctx).Error("fail to connect store", zap.Uint64("StoreID", storeID))
Expand Down Expand Up @@ -1374,10 +1358,7 @@ func (bc *Client) handleFineGrained(
// When the leader store is died,
// 20s for the default max duration before the raft election timer fires.
logutil.CL(ctx).Warn("failed to connect to store, skipping", logutil.ShortError(err), zap.Uint64("storeID", storeID))
return disconnectRetryTimeout, &StoreBasedErr{
storeID: storeID,
err: err,
}
return 20000, nil
}
logutil.CL(ctx).Error("failed to send fine-grained backup", zap.Uint64("storeID", storeID), logutil.ShortError(err))
return 0, errors.Annotatef(err, "failed to send fine-grained backup [%s, %s)",
Expand Down
49 changes: 0 additions & 49 deletions br/tests/br_fine_grained_disconnect/run.sh

This file was deleted.

12 changes: 0 additions & 12 deletions br/tests/br_fine_grained_disconnect/workload

This file was deleted.

0 comments on commit 80db670

Please sign in to comment.