@@ -118,7 +118,6 @@ const (
118118 // We need to be more patient.
119119 backupFineGrainedMaxBackoff = 3600000
120120 backupRetryTimes = 5
121- disconnectRetryTimeout = 20000
122121 // RangeUnit represents the progress updated counter when a range finished.
123122 RangeUnit ProgressUnit = "range"
124123 // RegionUnit represents the progress updated counter when a region finished.
@@ -1159,7 +1158,6 @@ func (bc *Client) fineGrainedBackup(
11591158 })
11601159
11611160 bo := utils .AdaptTiKVBackoffer (ctx , backupFineGrainedMaxBackoff , berrors .ErrUnknown )
1162- maxDisconnect := make (map [uint64 ]uint )
11631161 for {
11641162 // Step1, check whether there is any incomplete range
11651163 incomplete := pr .Res .GetIncompleteRange (req .StartKey , req .EndKey )
@@ -1207,19 +1205,8 @@ func (bc *Client) fineGrainedBackup(
12071205 for {
12081206 select {
12091207 case err := <- errCh :
1210- if ! berrors .Is (err , berrors .ErrFailedToConnect ) {
1211- return errors .Trace (err )
1212- }
1213- storeErr , ok := err .(* StoreBasedErr )
1214- if ! ok {
1215- return errors .Trace (err )
1216- }
1217-
1218- storeID := storeErr .storeID
1219- maxDisconnect [storeID ]++
1220- if maxDisconnect [storeID ] > backupRetryTimes {
1221- return errors .Annotatef (err , "Failed to connect to store %d more than %d times" , storeID , backupRetryTimes )
1222- }
1208+ // TODO: should we handle err here?
1209+ return errors .Trace (err )
12231210 case resp , ok := <- respCh :
12241211 if ! ok {
12251212 // Finished.
@@ -1332,10 +1319,7 @@ func (bc *Client) handleFineGrained(
13321319 // When the leader store is died,
13331320 // 20s for the default max duration before the raft election timer fires.
13341321 logutil .CL (ctx ).Warn ("failed to connect to store, skipping" , logutil .ShortError (err ), zap .Uint64 ("storeID" , storeID ))
1335- return disconnectRetryTimeout , & StoreBasedErr {
1336- storeID : storeID ,
1337- err : err ,
1338- }
1322+ return 20000 , nil
13391323 }
13401324
13411325 logutil .CL (ctx ).Error ("fail to connect store" , zap .Uint64 ("StoreID" , storeID ))
@@ -1374,10 +1358,7 @@ func (bc *Client) handleFineGrained(
13741358 // When the leader store is died,
13751359 // 20s for the default max duration before the raft election timer fires.
13761360 logutil .CL (ctx ).Warn ("failed to connect to store, skipping" , logutil .ShortError (err ), zap .Uint64 ("storeID" , storeID ))
1377- return disconnectRetryTimeout , & StoreBasedErr {
1378- storeID : storeID ,
1379- err : err ,
1380- }
1361+ return 20000 , nil
13811362 }
13821363 logutil .CL (ctx ).Error ("failed to send fine-grained backup" , zap .Uint64 ("storeID" , storeID ), logutil .ShortError (err ))
13831364 return 0 , errors .Annotatef (err , "failed to send fine-grained backup [%s, %s)" ,
0 commit comments