Skip to content

Commit

Permalink
This is an automated cherry-pick of pingcap#48529
Browse files Browse the repository at this point in the history
Signed-off-by: ti-chi-bot <[email protected]>
  • Loading branch information
Leavrth authored and ti-chi-bot committed Nov 13, 2023
1 parent cf8dbc2 commit 8eb0baf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions br/pkg/utils/backoff.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ func NewDownloadSSTBackoffer() Backoffer {
}

func (bo *importerBackoffer) NextBackoff(err error) time.Duration {
log.Warn("retry to import ssts", zap.Int("attempt", bo.attempt), zap.Error(err))
if MessageIsRetryableStorageError(err.Error()) {
bo.delayTime = 2 * bo.delayTime
bo.attempt--
Expand Down
5 changes: 5 additions & 0 deletions br/pkg/utils/retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ var retryableServerError = []string{
"internalerror",
"not read from or written to within the timeout period",
"<code>requesttimeout</code>",
<<<<<<< HEAD
=======
"<code>invalidpart</code>",
"end of file before message length reached",
>>>>>>> f33d5a76a57 (br: add more retryable error for br_import (#48529))
}

// RetryableFunc presents a retryable operation.
Expand Down
4 changes: 4 additions & 0 deletions br/tests/br_full/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ test_log="${TEST_DIR}/${DB}_test.log"
error_str="not read from or written to within the timeout period"
unset BR_LOG_TO_TERM

<<<<<<< HEAD
export GO_FAILPOINTS="github.com/pingcap/tidb/br/pkg/backup/backup-storage-error=1*return(\"connection refused\")->1*return(\"InternalError\");github.com/pingcap/tidb/br/pkg/backup/backup-timeout-error=1*return(\"<Code>RequestTimeout</Code>\")->1*return(\"not read from or written to within the timeout period\")"
=======
export GO_FAILPOINTS="github.com/pingcap/tidb/br/pkg/backup/backup-storage-error=1*return(\"connection refused\")->1*return(\"InternalError\");github.com/pingcap/tidb/br/pkg/backup/backup-timeout-error=1*return(\"<Code>RequestTimeout</Code>\")->1*return(\"not read from or written to within the timeout period\")->1*return(\"<Code>InvalidPart</Code>\")->1*return(\"end of file before message length reached\")"
>>>>>>> f33d5a76a57 (br: add more retryable error for br_import (#48529))
run_br --pd $PD_ADDR backup full -s "local://$TEST_DIR/$DB-lz4" --concurrency 4 --compression lz4 --log-file $test_log
export GO_FAILPOINTS=""
size_lz4=$(du -d 0 $TEST_DIR/$DB-lz4 | awk '{print $1}')
Expand Down

0 comments on commit 8eb0baf

Please sign in to comment.