@@ -118,7 +118,6 @@ const (
118
118
// We need to be more patient.
119
119
backupFineGrainedMaxBackoff = 3600000
120
120
backupRetryTimes = 5
121
- disconnectRetryTimeout = 20000
122
121
// RangeUnit represents the progress updated counter when a range finished.
123
122
RangeUnit ProgressUnit = "range"
124
123
// RegionUnit represents the progress updated counter when a region finished.
@@ -1159,7 +1158,6 @@ func (bc *Client) fineGrainedBackup(
1159
1158
})
1160
1159
1161
1160
bo := utils .AdaptTiKVBackoffer (ctx , backupFineGrainedMaxBackoff , berrors .ErrUnknown )
1162
- maxDisconnect := make (map [uint64 ]uint )
1163
1161
for {
1164
1162
// Step1, check whether there is any incomplete range
1165
1163
incomplete := pr .Res .GetIncompleteRange (req .StartKey , req .EndKey )
@@ -1207,19 +1205,8 @@ func (bc *Client) fineGrainedBackup(
1207
1205
for {
1208
1206
select {
1209
1207
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 )
1223
1210
case resp , ok := <- respCh :
1224
1211
if ! ok {
1225
1212
// Finished.
@@ -1332,10 +1319,7 @@ func (bc *Client) handleFineGrained(
1332
1319
// When the leader store is died,
1333
1320
// 20s for the default max duration before the raft election timer fires.
1334
1321
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
1339
1323
}
1340
1324
1341
1325
logutil .CL (ctx ).Error ("fail to connect store" , zap .Uint64 ("StoreID" , storeID ))
@@ -1374,10 +1358,7 @@ func (bc *Client) handleFineGrained(
1374
1358
// When the leader store is died,
1375
1359
// 20s for the default max duration before the raft election timer fires.
1376
1360
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
1381
1362
}
1382
1363
logutil .CL (ctx ).Error ("failed to send fine-grained backup" , zap .Uint64 ("storeID" , storeID ), logutil .ShortError (err ))
1383
1364
return 0 , errors .Annotatef (err , "failed to send fine-grained backup [%s, %s)" ,
0 commit comments