From d6e8ba4d45324aff8f1cd3fd814b7d4a96da1f52 Mon Sep 17 00:00:00 2001 From: Jianjun Liao <36503113+Leavrth@users.noreply.github.com> Date: Mon, 13 Nov 2023 14:50:15 +0800 Subject: [PATCH] br: add more retryable error for br_import (#48529) close pingcap/tidb#48528 --- br/pkg/utils/backoff.go | 1 + br/pkg/utils/retry.go | 1 + br/tests/br_full/run.sh | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/br/pkg/utils/backoff.go b/br/pkg/utils/backoff.go index 93e8c6afa52ff..1a9f157807f3e 100644 --- a/br/pkg/utils/backoff.go +++ b/br/pkg/utils/backoff.go @@ -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-- diff --git a/br/pkg/utils/retry.go b/br/pkg/utils/retry.go index b4ab0437cf651..8756f2ca33943 100644 --- a/br/pkg/utils/retry.go +++ b/br/pkg/utils/retry.go @@ -29,6 +29,7 @@ var retryableServerError = []string{ "internalerror", "not read from or written to within the timeout period", "requesttimeout", + "end of file before message length reached", } // RetryableFunc presents a retryable operation. diff --git a/br/tests/br_full/run.sh b/br/tests/br_full/run.sh index dc785a75423f8..9853f3ea87b88 100755 --- a/br/tests/br_full/run.sh +++ b/br/tests/br_full/run.sh @@ -52,7 +52,7 @@ test_log="${TEST_DIR}/${DB}_test.log" error_str="not read from or written to within the timeout period" unset BR_LOG_TO_TERM -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(\"RequestTimeout\")->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(\"RequestTimeout\")->1*return(\"not read from or written to within the timeout period\")->1*return(\"end of file before message length reached\")" 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}')