-
Notifications
You must be signed in to change notification settings - Fork 652
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
Perform unmap when mlock fails or both meta pages corrupted #433
Merged
+65
−3
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back 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.
@ahrtr
I would be explicit in that error that it's 'rollback unmap also failed'.
I had some doubts whether we should execute here unmap or just db.invalidate.
Ideally cleanup for failing mmap() (like rollback unmap) should be handled within the mmap() function's logic, rather than assumed externally.
If we suspect the failing rollbacks might be reason for the double-linking issues,
by submitting this patch, we are making it more difficult to build repro (i.e. we need to test with & without that patch). It would be good to split failpoints (helping with repro) from the 'fix' PR.
Next time please ping me or @serathius a little longer for business logic change - to not create precedences.
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.
Thanks for the suggestion. Will fix it separately.
Definitely we should execute
db.unmap
instead ofdb.invalidate
. Note that the deferred function will only be executed when mmap already succeeded but (1) mlock somehow failed or (2) both meta pages are corrupted.Not sure what do you mean by "double-linking issues", could you clarify this? I found the issue with the new added test cases in this PR, so I fixed it in the same PR. I plan to backport both failpoints and all bug fixes to release-1.3, please see #436. Please let me know if you still have any concern.
Sorry to merge this PR without another maintainer's approval. I do think it's a safe change, and It's already reviewed by three experienced contributors. But anyway, will try to follow the process next time.
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.
#438
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.
If the PR indeed fixes the problem. You might struggle to repro problem that got already fixed.
I'm not saying I have concerns about this PR, just flagging.
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.
Thanks for the reminder.