hangc0276 opened a new pull request, #3263:
URL: https://github.com/apache/bookkeeper/pull/3263

   ### Motivation
   Task 6 of BP-47, Direct I/O entrylogger support.
   
   This is a standalone module for direct I/O entry logger support.
   
   ### Modification
   The implementation uses JNI to do direct I/O to files via posix syscalls. 
Fallocate is used if running on linux, otherwise this is skipped (at the cost 
of more filesystem operates during writing).
   
   There are two calls to write, writeAt and writeDelimited. I expect writeAt 
to be used for the entrylog headers, which entries will go through 
writeDelimited. In both cases, the calls may return before the syscalls occur. 
#flush() needs to be called to ensure things are actually written.
   
   The entry log format isn't much changed from what is used by the existing 
entrylogger. The biggest difference is the padding. Direct I/O must write in 
aligned blocked. The size of the alignment varies by machine configuration, but 
4K is a safe bet on most. As it is unlikely that entry data will land exactly 
on the alignment boundary, we need to add padding to writes. The existing entry 
logger has been changed to take this padding into account. When read as a 
signed int/long/byte the padding will aways parse to a negative value, which 
distinguishes it from valid entry data (the entry size will always be positive) 
and also from preallocated space (which is always 0).
   
   Another difference in the format is that the header is now 4K rather than 
1K. Again, this is to allow aligned rights. No changes are necessary to allow 
the existing entry logger to deal with the header change, as we create a dummy 
entry in the extra header space that the existing entry logger already knows to 
ignore.
   
   ### Others
   The commit is made by @ivankelly . This is the sub task of 
https://github.com/apache/bookkeeper/pull/2932 , which pushed out by 
@mauricebarnum. However, this PR contains too many changes and the number of 
code lines reaches 8K+, and it is hard to review. According to your suggestion 
https://github.com/apache/bookkeeper/pull/2932#issuecomment-1072882245, and 
after communicate with @mauricebarnum, we are planing to divide the PR into 6 
PRs, Please refer to 
https://github.com/apache/bookkeeper/issues/2943#issuecomment-1086446251.
   
   However, @mauricebarnum doesn't have enough time to deal with those issues, 
and we desperately need this feature. After communicated with @mauricebarnum 
and @merlimat , I help to work on divide the PRs and push them out. We are 
hoping to contain this feature in BookKeeper 4.16.0
   


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