-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[close #220] TiKV-BR support key range #221
Conversation
Signed-off-by: haojinming <[email protected]>
Signed-off-by: haojinming <[email protected]>
Signed-off-by: haojinming <[email protected]>
Signed-off-by: haojinming <[email protected]>
Signed-off-by: haojinming <[email protected]>
Signed-off-by: haojinming <[email protected]>
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #221 +/- ##
================================================
- Coverage 54.4832% 54.3760% -0.1072%
================================================
Files 236 236
Lines 20298 20178 -120
================================================
- Hits 11059 10972 -87
+ Misses 8361 8329 -32
+ Partials 878 877 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Signed-off-by: haojinming <[email protected]>
Signed-off-by: haojinming <[email protected]>
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.
LGTM~
|
||
require.True(t, g.OwnsStorage()) | ||
|
||
ctx := context.Background() |
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.
What is verified in this block ?
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.
Just to cover the code to verify no crash occurs.
br/tests/rawkv/main.go
Outdated
if err != nil { | ||
return err | ||
} | ||
totalCnt += batchCnt |
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.
Should be atomic addition.
br/tests/rawkv/main.go
Outdated
{StartKey: []byte{}, EndKey: []byte{}}, | ||
{StartKey: q1Key, EndKey: q3Key}, | ||
} | ||
for _, keyRange := range backupRanges { |
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.
Nit: it seems better to treat backupRanges
as test cases, and move the loop to main
.
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.
Done
br/tests/rawkv/main.go
Outdated
log.Panic("ClearStorage fail", zap.Error(err)) | ||
} | ||
safeInterval := int64(120) // 2m | ||
backupOutput, err := tester.Backup(ctx, kvrpcpb.APIVersion_V2, safeInterval, keyRange.StartKey, keyRange.EndKey) |
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.
Suggest to also verify the backup result by restore + checksum.
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.
There is a bit problem here, we only deploy one cluster in integration test. May need deploy apiv1 & apiv2 clusters to verify the conversion result.
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.
Got it. We may consider to deploy two clusters for this test case 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.
Ok,I will improve it later.
Signed-off-by: haojinming <[email protected]>
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.
LGTM~
What problem does this PR solve?
Issue Number: close #220
Problem Description:
What is changed and how does it work?
Support key range in backup & restore.
Code changes
Check List for Tests
This PR has been tested by at least one of the following methods:
Side effects
Related changes