-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
br: clean codes -- restore tables #55519
br: clean codes -- restore tables #55519
Conversation
Signed-off-by: Jianjun Liao <[email protected]>
Hi @Leavrth. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Signed-off-by: Jianjun Liao <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #55519 +/- ##
================================================
+ Coverage 72.8739% 75.7049% +2.8310%
================================================
Files 1576 1585 +9
Lines 440775 454817 +14042
================================================
+ Hits 321210 344319 +23109
+ Misses 99821 89552 -10269
- Partials 19744 20946 +1202
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Signed-off-by: Jianjun Liao <[email protected]>
Signed-off-by: Jianjun Liao <[email protected]>
br/pkg/rtree/rtree.go
Outdated
@@ -85,8 +84,67 @@ func (rg *Range) Less(than btree.Item) bool { | |||
return bytes.Compare(rg.StartKey, ta.StartKey) < 0 | |||
} | |||
|
|||
var _ btree.Item = &RangeStats{} |
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.
Range for backup, RangeStats for restore to be merged
defer updateCh.Close() | ||
sender, err := snapclient.NewTiKVSender(ctx, client, updateCh, cfg.PDConcurrency) | ||
placementRuleManager, err := snapclient.NewPlacementRuleManager(ctx, mgr.GetPDClient(), mgr.GetPDHTTPClient(), mgr.GetTLSConfig(), cfg.Online) |
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 are many functions that set something before split&scatter
and download&ingest
and reset after that. We can unify them into one context manager.
@@ -324,133 +114,29 @@ func (b *Batcher) filterOutRanges(checkpointSet map[string]struct{}, drained []r | |||
// |--|-------| | |||
// |t2|t3 | | |||
// as you can see, all restored ranges would be removed. | |||
func (b *Batcher) drainRanges() DrainResult { | |||
func drainRanges( |
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.
will be removed by the next PR
Signed-off-by: Jianjun Liao <[email protected]>
/retest |
@Leavrth: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
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.
rest lgtm
Signed-off-by: Jianjun Liao <[email protected]>
Signed-off-by: Jianjun Liao <[email protected]>
/retest |
@Leavrth: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
@@ -1,81 +0,0 @@ | |||
#!/bin/sh |
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.
This test is used for small tables scenario test. Shall we keep it?
@@ -48,6 +51,14 @@ func MergeAndRewriteFileRanges( | |||
for _, file := range files { | |||
filesMap[string(file.StartKey)] = append(filesMap[string(file.StartKey)], file) | |||
|
|||
// Assert that it has the same end key. | |||
if !bytes.Equal(filesMap[string(file.StartKey)][0].EndKey, file.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.
why need this check? for some scenarios like compacted ssts may not satisfied.
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.
To assert range's start-key and end-key is the same as that of any file of the range.
// RangeStats represents a restore merge result. | ||
type RangeStats struct { | ||
Range | ||
Size uint64 |
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.
Size and Count seems never used...
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.
Used in the next PR
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 3pointer, YuJuncen The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/ok-to-test |
What problem does this PR solve?
Issue Number: ref #52877
Problem Summary:
we can clean some codes
What changed and how does it work?
simplify the
split & scatter
anddownload & ingest
stagesCheck List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.