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 2018/06/26 01:23:01 UTC

[GitHub] reddycharan commented on issue #1527: Make ExplicitLAC persistent

reddycharan commented on issue #1527: Make ExplicitLAC persistent
URL: https://github.com/apache/bookkeeper/issues/1527#issuecomment-400146255
 
 
   @jvrao @sijie @eolivelli 
   
   For persisting explicitLAC, we can follow the same approach as followed in persisting fencing information / stateBits (https://github.com/apache/bookkeeper/commit/d69986c4df6b51ed6ed27c5f45a7b6850e69dacd) in FileInfo file and special marker entry in Journal.
   
   We can have a new marker METAENTRY_ID_LEDGER_EXPLICITLAC = -0x8000 and we can log a special entry in journal (just like fence entry) when we get setExplicitLAC call to the bookie. This special entry could be following 
   
   ```
       static ByteBuf createExplicitLACEntry(long ledgerId, long entryId) {
           ByteBuf bb = Unpooled.buffer(8 + 8 + 8);
           bb.writeLong(ledgerId);
           bb.writeLong(METAENTRY_ID_LEDGER_EXPLICITLAC);
           bb.writeLong(entryId);
           return bb;
       }
   ```
   
   The long explicitLAC value could be stored in the header of the FileInfo after 'stateBits' value, as there is sufficient space remaining in FileInfo allocated header (1024). For explicitLAC, we can follow the same semantics as fence/statebits logic for flushHeader/checkpoint and replay journal .
   
   But there is some small intricacy here regarding 'HEADER_VERSION' of the FileInfo. Since zero is valid ExplicitLac value for a Ledger, for backward compatibility purpose we cannot just consider the read zero value from HEADER after 'statebits' in old FileInfo file, as persisted 'ExplicitLAC'. So we may need to bump up 'HEADER_VERSION' of FileInfo for implementing this feature and handle compatibility scenarios.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services