Skip to content

Commit

Permalink
Fix cache entry
Browse files Browse the repository at this point in the history
  • Loading branch information
mattisonchao committed Aug 4, 2022
1 parent f6d0bd8 commit 8a5e1c0
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,10 @@ private void asyncReadEntry0(ReadHandle lh, PositionImpl position, AsyncCallback
EntryImpl cachedEntry = entryCacheManager.get(position.getLedgerId(), position.getEntryId());

if (cachedEntry != null) {
entryCacheManager.getFactoryMBean().recordCacheHit(cachedEntry.getLength());
callback.readEntryComplete(cachedEntry, ctx);
EntryImpl entry = EntryImpl.create(cachedEntry);
cachedEntry.release();
entryCacheManager.getFactoryMBean().recordCacheHit(entry.getLength());
callback.readEntryComplete(entry, ctx);
} else {
lh.readAsync(position.getEntryId(), position.getEntryId()).thenAcceptAsync(
ledgerEntries -> {
Expand Down

0 comments on commit 8a5e1c0

Please sign in to comment.