-
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/stream: Added toolkit for managing migrations #55665
Conversation
Hi @YuJuncen. 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. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #55665 +/- ##
=================================================
- Coverage 73.3721% 58.7260% -14.6462%
=================================================
Files 1626 1781 +155
Lines 448978 652968 +203990
=================================================
+ Hits 329425 383462 +54037
- Misses 99368 244837 +145469
- Partials 20185 24669 +4484
Flags with carried forward coverage won't be shown. Click here to find out more.
|
095f623
to
e183b20
Compare
br/pkg/storage/local.go
Outdated
err := os.Remove(path) | ||
if err != nil && | ||
l.IgnoreEnoentForDelete && | ||
stderrors.Is(err, syscall.ENOENT) { |
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.
local external storage also support windows, so can syscall.ENOENT
also match the error occur in windows system?
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.
I guess for now TiDB doesn't have any compatibility promise for windows?
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.
I have checked that this won't make TiDB failed to compile in Windows. As this only affects test cases, I think it could be fine to don't specially handle this in Windows system.
HandingMetaEditDone() | ||
} | ||
|
||
func NewProgressBarHooks(console glue.ConsoleOperations) *ProgressBarHooks { |
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.
is it dead code? or will be called outside?
|
||
me := new(pb.MetaEdit) | ||
me.Path = path | ||
for _, ds := range meta.FileGroups { |
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 we also append the me.DeleteLogicalFiles
because m.applyMetaEditTo
uses it?
|
||
// MergeAndMigrateTo will merge the migrations from BASE until the specified SN, then migrate to it. | ||
// Finally it writes the new BASE and remove stale migrations from the storage. | ||
func (m MigrationExt) MergeAndMigrateTo( |
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.
I found there are many functions only used in unit test, so I prefer to move these functions to another file with suffix _test.go
to read and check codes for production more clearly.
35c734a
to
6ce016f
Compare
/retest |
@YuJuncen: 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. |
/ok-to-test |
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. There are some functions used by another PR, so need to review again with the PR.
for _, edit := range s2 { | ||
target, ok := edits[edit.GetPath()] | ||
if !ok { | ||
edits[edit.GetPath()] = edit |
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 we also create a new &pb.MetaEdit
the same as edit
in s1
?
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.
I guess no, we are copying the first one because we may modify the content of Delete[Physical|Logical]Files
then. In this case we won't edit them.
/test pull-br-integration-test Some |
@YuJuncen: The specified target(s) for
The following commands are available to trigger optional jobs:
Use
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/test-infra repository. |
@YuJuncen: The specified target(s) for
Use
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. |
/retest-required |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 3pointer, Leavrth 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 |
/test check-dev |
@YuJuncen: The specified target(s) for
Use
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. |
/retest-required |
What problem does this PR solve?
Issue Number: close #55661
Problem Summary:
See the issue.
What changed and how does it work?
We added some new interfaces that helps to manipulate migrations. They are provided by a wrapper over
ExternalStorage
namedMigrationExt
.MergeAndMigrateTo
is the main interface for executing pending migrations.Load
loads the persisted migrations.Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.