This repository has been archived by the owner on Dec 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 66
backend/local: do not retry epochNotMatch error when ingest sst #419
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d07ab07
do not retry epochNotMatch error when ingest sst
glorv f92cf31
add retry ingest for 'Raft raft: proposal dropped' error in ingest
glorv b4fd955
change some retryable error log level from Error to Warn
glorv c4faf80
fix nextKey
glorv 7aaf949
add a comment for nextKey
glorv 1cfa0b3
Merge branch 'master' of https://github.com/pingcap/tidb-lightning in…
glorv 57113da
fix comment and add a unit test
glorv a4459f2
wrap time.Sleep in select
glorv 533c6f5
Merge branch 'master' into not-retry-ingest
kennytm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package backend | ||
|
||
import ( | ||
"bytes" | ||
|
||
. "github.com/pingcap/check" | ||
) | ||
|
||
type localSuite struct{} | ||
|
||
var _ = Suite(&localSuite{}) | ||
|
||
func (s *localSuite) TestNextKey(c *C) { | ||
c.Assert(nextKey([]byte{}), DeepEquals, []byte{}) | ||
|
||
cases := [][]byte{ | ||
{0}, | ||
{255}, | ||
{1, 255}, | ||
} | ||
for _, b := range cases { | ||
next := nextKey(b) | ||
c.Assert(next, DeepEquals, append(b, 0)) | ||
} | ||
|
||
// in the old logic, this should return []byte{} which is not the actually smallest eky | ||
next := nextKey([]byte{1, 255}) | ||
c.Assert(bytes.Compare(next, []byte{2}), Equals, -1) | ||
|
||
// another test case, nextkey()'s return should be smaller than key with a prefix of the origin key | ||
next = nextKey([]byte{1, 255}) | ||
c.Assert(bytes.Compare(next, []byte{1, 255, 0, 1, 2}), Equals, -1) | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a unit test?