Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
jiawen li
tidb
Commits
f5965a16
Unverified
Commit
f5965a16
authored
3 years ago
by
Yujie Xia
Committed by
GitHub
3 years ago
Browse files
Options
Download
Email Patches
Plain Diff
lightning: fix test lightning_error_summary (#33616)
close pingcap/tidb#33614
parent
17a9fc4a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
br/pkg/lightning/restore/restore.go
+1
-1
br/pkg/lightning/restore/restore.go
br/pkg/lightning/restore/table_restore_test.go
+7
-3
br/pkg/lightning/restore/table_restore_test.go
with
8 additions
and
4 deletions
+8
-4
br/pkg/lightning/restore/restore.go
+
1
-
1
View file @
f5965a16
...
...
@@ -972,7 +972,7 @@ func (rc *Controller) saveStatusCheckpoint(ctx context.Context, tableName string
switch
{
case
err
==
nil
:
break
case
utils
.
IsRetryableError
(
err
),
utils
.
MessageIsRetryableStorageError
(
err
.
Error
()),
common
.
IsContextCanceledError
(
err
)
:
case
utils
.
MessageIsRetryableStorageError
(
err
.
Error
()),
common
.
IsContextCanceledError
(
err
)
:
// recoverable error, should not be recorded in checkpoint
// which will prevent lightning from automatically recovering
return
nil
...
...
This diff is collapsed.
Click to expand it.
br/pkg/lightning/restore/table_restore_test.go
+
7
-
3
View file @
f5965a16
...
...
@@ -18,7 +18,6 @@ import (
"context"
"encoding/json"
"fmt"
"net"
"net/http"
"net/http/httptest"
"os"
...
...
@@ -996,9 +995,14 @@ func (s *tableRestoreSuite) TestSaveStatusCheckpoint() {
require
.
NoError
(
s
.
T
(),
err
)
require
.
Equal
(
s
.
T
(),
0
,
len
(
rc
.
errorSummaries
.
summary
))
err
=
rc
.
saveStatusCheckpoint
(
context
.
Background
(),
common
.
UniqueTable
(
"test"
,
"tbl"
),
indexEngineID
,
&
net
.
DNSError
{
IsTimeout
:
true
},
checkpoints
.
CheckpointStatusImported
)
err
=
rc
.
saveStatusCheckpoint
(
context
.
Background
(),
common
.
UniqueTable
(
"test"
,
"tbl"
),
indexEngineID
,
common
.
ErrChecksumMismatch
.
GenWithStackByArgs
(
0
,
0
,
0
,
0
,
0
,
0
),
checkpoints
.
CheckpointStatusImported
,
)
require
.
NoError
(
s
.
T
(),
err
)
require
.
Equal
(
s
.
T
(),
0
,
len
(
rc
.
errorSummaries
.
summary
))
require
.
Equal
(
s
.
T
(),
1
,
len
(
rc
.
errorSummaries
.
summary
))
start
:=
time
.
Now
()
err
=
rc
.
saveStatusCheckpoint
(
context
.
Background
(),
common
.
UniqueTable
(
"test"
,
"tbl"
),
indexEngineID
,
nil
,
checkpoints
.
CheckpointStatusImported
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help