sijie commented on issue #671: WIP - BP-14 Relax Durability - patch 2 - force() 
API for FORCE_DEFERRED_ON_JOURNAL LedgerType
URL: https://github.com/apache/bookkeeper/pull/671#issuecomment-340029678
 
 
   @eolivelli I am not sure why do you need to play with journal here. I think 
I have proposed a solution in the design doc before. Let me try to write a 
detailed one here:
   
   1) you can have the `LastAddSynced tracker (or cursor) per ledger. it can 
just simply associated with ledger index.
   2) on a file info reloaded, you can reconstruct the cursor: a) you know the 
`LastAddConfirmed` for a ledger b) read the index file starting from 
`LastAddConfirmed`, you will know what entries after `LastAddConfirmed` has 
been persisted by this bookie, stop at a non existed entry. then it is 
`LastAddSynced`.  
   3) cursor tracking are all in memory only, you don't need to write back 
anything.
   4) cursor is updated: a) when an entry is persisted by journal; b) when 
`LastAddConfirmed` is added. for example, cursor is [las=10, persisted=12, 13, 
15, 16]. if 11 is persisted, las will become 13, because all 11, 12, 13 have 
been persisted. if `LastAddConfirmed` is updated to 14, that means 14 has 
already been persisted to its ensemble, it is safe to advance last to 16, 
because all entries before 14 are already persisted in quorum, 15 and 16 are 
already persisted locally.
   5) cursor can be stored in a more compacted format, rather than a flat tree 
map.
   6) for FORCE_ON_JOURNAL ledger type, there should be no cursor for tracking 
`LastAddSynced`. we should not add any overhead to existing behaviors.
   
   Hope this explain.
   
   Also, since we are changing `sync()` to `force`, please rename 
`LastAddSynced` to `LastAddForced` as well, to keep consistency.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to