lhotari commented on PR #4607:
URL: https://github.com/apache/bookkeeper/pull/4607#issuecomment-3226887414

   > 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.
   
   @oneby-wang @nsnycde I guess that the file might be read by GC before that 
happens. This PR addresses the issue that there's garbage in the initial 
header. The original assumption has been that the header would be initialized 
with zeros. However, that assumption didn't hold with Netty's optimized array 
allocation as explained in 
https://github.com/apache/bookkeeper/pull/4607#issuecomment-2918429558 . 
   If there's an invalid header in the entry log file, it could get deleted in 
GC instead of skipped. There's also the chance that the header just happens to 
contain data the gets interpreted as valid data in GC. At least this is how I 
understood the problem and the fix.


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