You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2022/07/07 16:31:43 UTC

[GitHub] [bookkeeper] wenbingshen commented on a diff in pull request #3329: Fix data lost when configured multiple ledger directories

wenbingshen commented on code in PR #3329:
URL: https://github.com/apache/bookkeeper/pull/3329#discussion_r916071847


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Journal.java:
##########
@@ -245,7 +246,8 @@ void readLog() {
                     }
                     bb.clear();
                     mark.readLogMark(bb);
-                    if (curMark.compare(mark) < 0) {
+                    // get the minimum mark position from all the ledger directories to ensure no data loss.
+                    if (curMark.compare(mark) > 0) {

Review Comment:
   Since we are now replaying the journal from the smallest LogMark, can we get the journal log mark position of the current entry to the JournalScanner and compare it with the checkpoint position on the ledger disk where the entry to be restored is located, and only restore the entry whose logMark position is greater than the checkpoint? So as to avoid repeatedly writing the data that has been flushed to the disk.



-- 
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: issues-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org