Skip to content
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: fix the issue that key is not in region. #32877

Merged
merged 8 commits into from
Mar 9, 2022

Conversation

3pointer
Copy link
Contributor

@3pointer 3pointer commented Mar 7, 2022

What problem does this PR solve?

Issue Number: close #31980

Problem Summary:
some key range in backup may not equal to restore regions. this PR try to resolve this issue. by given a region range to filter the key out of range in sst_importer.

What is changed and how it works?

  1. give a range to sst_importer make br-stream: remove duplicate entry in apply kv file 3pointer/tikv#28 passed.
  2. use prefix search to speed up collect meta file during log restore.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

None

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Mar 7, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • YuJuncen
  • kennytm

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 7, 2022
@ti-chi-bot ti-chi-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 7, 2022
@3pointer
Copy link
Contributor Author

3pointer commented Mar 7, 2022

/run-check_dev

1 similar comment
@3pointer
Copy link
Contributor Author

3pointer commented Mar 8, 2022

/run-check_dev

@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 8, 2022
@ti-chi-bot ti-chi-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 8, 2022
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 8, 2022
@@ -73,6 +77,10 @@ func (l *LocalStorage) WalkDir(ctx context.Context, opt *WalkOption, fn func(str
// so use Rel to convert to relative path to l.base
path, _ = filepath.Rel(l.base, path)

if !strings.HasPrefix(path, opt.ObjPrefix) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe strings.HasPrefix(f.Name(), opt.ObjPrefix)(which only contains the file name e.g. foo.log instead of full path e.g. /some/dir/foo.log)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

path become filename after L78.
I had a unit case to cover this.

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Mar 8, 2022
@3pointer 3pointer merged commit ce0b12c into pingcap:br-stream Mar 9, 2022
3pointer added a commit that referenced this pull request Mar 21, 2022
* add ObjPrefix to speed up walkDir in br-stream

* add start/end key to filter unnecessay key
3pointer added a commit to 3pointer/tidb that referenced this pull request Mar 21, 2022
* add ObjPrefix to speed up walkDir in br-stream

* add start/end key to filter unnecessay key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants