-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
/run-check_dev |
1 similar comment
/run-check_dev |
@@ -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) { |
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.
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
)?
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.
path
become filename
after L78.
I had a unit case to cover this.
* add ObjPrefix to speed up walkDir in br-stream * add start/end key to filter unnecessay key
* add ObjPrefix to speed up walkDir in br-stream * add start/end key to filter unnecessay key
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?
Check List
Tests
Side effects
Documentation
Release note