LastAddConfirmed (LAC) is a hint entry id carried on each entry written by a ledger writer, which indicates that all the entries before LAC have already acknowledged by the writer. So the reader is safe to read all the entries written before LAC.
Currently a bookkeeper reader doesn’t sync LAC with the bookkeeper writer. So a bookkeeper reader has to read LAC (aka LedgerHandle#readLastConfirmed) before getting the latest entries written by the writer.
Such polling behavior results in poor performance:
- Delay on reading entries if we are setting a larger polling interval.
- ReadLastConfirm needs to wait all the responses from all bookies in last ensemble. This constraint is required for Ledger Recovery Procedure, but not for the reader just needs to know latest LAC.
- It might Introduce useless polling loads to bookie servers if we are setting a smaller polling interval.
A notification mechanism is good to reduce round-trips that a reader spent on polling LAC.