oneby-wang commented on PR #4607:
URL: https://github.com/apache/bookkeeper/pull/4607#issuecomment-3182824251

   Hi, I'm wondering what situation will cause data loss(caused by wrong file 
header)? I read the source code, it seems the file header is updated by 
BufferedLogChannel.appendLedgersMap() method.
   ```java
   BufferedLogChannel
     void appendLedgersMap() throws IOException {
       // ...
   
       // Update the headers with the map offset and count of ledgers
       ByteBuffer mapInfo = ByteBuffer.allocate(8 + 4);
       mapInfo.putLong(ledgerMapOffset);
       mapInfo.putInt(numberOfLedgers);
       mapInfo.flip();
       this.fileChannel.write(mapInfo, LEDGERS_MAP_OFFSET_POSITION);
   }
   ```


-- 
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]

Reply via email to