void-ptr974 commented on code in PR #4740:
URL: https://github.com/apache/bookkeeper/pull/4740#discussion_r3050775514
##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Journal.java:
##########
@@ -776,6 +788,15 @@ public void checkpointComplete(Checkpoint checkpoint,
boolean compact) throws IO
LogMarkCheckpoint lmcheckpoint = (LogMarkCheckpoint) checkpoint;
LastLogMark mark = lmcheckpoint.mark;
+ // Monotonic check: only advance lastMark forward, never backwards.
+ synchronized (checkpointLock) {
+ if (mark.getCurMark().compare(lastPersistedMark) <= 0) {
+ return;
+ }
+ lastPersistedMark.setLogMark(
+ mark.getCurMark().getLogFileId(),
mark.getCurMark().getLogFileOffset());
+ }
+
mark.rollLog(mark);
Review Comment:
if rolllog throw exception the bookie will come into readonly state which
should be handle by ops. so won't handle this exception. and the disk IO in
synchronized code block is not acceptable.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]