-
Notifications
You must be signed in to change notification settings - Fork 902
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
fix bug : update lastLogMark after journal file forceWrite #2983
fix bug : update lastLogMark after journal file forceWrite #2983
Conversation
rerun failure checks |
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.
LGTM
rerun failure checks |
ping |
3 similar comments
ping |
ping |
ping |
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.
Nice catch.
@eolivelli PTAL,thanks! |
ping |
@dlg99 @eolivelli @merlimat PTAL,thanks! |
ping |
1 similar comment
ping |
@dlg99 PTAL,thanks! |
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.
Can you please explain the problem you want to solve?
Sorry, I didn't describe the problem clearly. @eolivelli The lastLogMark update here should be updated after forceWrite is executed. Because it is possible that some data is still not flushed to the disk in the page cache, if the lastLogMark is updated at this time, when the node goes down, data may be lost. |
} | ||
lastLogMark.setCurLogMark(this.logId, this.lastFlushedPosition); |
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 think that we can reach this point in some cases when there is no need to force
for instance here we are closing the file
bookkeeper/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Journal.java
Line 524 in 63867a9
shouldForceWrite = false; |
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.
do you see any code path in which we arrive here and the journal has not been flushed and fsync'd ?
fix old workflow,please see #3455 for detail |
The ForceWriteRequest flush logic has been changed in the master branch, please confirm if the master code covered this change, thanks. @lordcheng10 |
I close this PR. If you still have the issues, please reopen it. @lordcheng10 |
Motivation
update lastLogMark after journal file forceWrite