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

   Descriptions of the changes in this PR:
   
   Fix #4900
   
   ### Motivation
   
   `SortedLedgerStorage.getLastAddConfirmed` delegated entirely to the index. 
Until the memtable is flushed, that LAC lives only in a `FileInfo` cache entry. 
Once the cache evicts the ledger, the index file still does not exist, so a 
later read fails with `NoLedgerException` / `NoEntryException` even though the 
entry is still in the memtable. The bookie turns that into `ENOLEDGER`.
   
   ### Changes
   
   On those misses, read the LAC from the last memtable entry (the same offset 
`addEntry` stores). If the entry was flushed between the miss and the lookup, 
ask the index again. A ledger that is in neither place still fails.
   
   ### Tests
   
   `mvn -pl bookkeeper-server -am test -Dtest=SortedLedgerStorageTest 
-Dsurefire.failIfNoSpecifiedTests=false`
   
   `SortedLedgerStorageTest` 6 tests, 0 failures. The new case expects LAC 3 
and got `NoEntryException: Entry 0 not found in 0` before the change.
   
   `mvn -pl bookkeeper-server checkstyle:check` — 0 violations.


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