Skip to content

Commit

Permalink
[improve][broker] Optimize high CPU usage when consuming from topics …
Browse files Browse the repository at this point in the history
…with ongoing txn (apache#23189)

(cherry picked from commit 94e1341)
(cherry picked from commit b7ffa73)
  • Loading branch information
coderzc authored and srinath-ctds committed Aug 23, 2024
1 parent 7047c2c commit c29f36a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ public void asyncReadEntriesWithSkipOrWait(int maxEntries, long maxSizeBytes, Re

int numberOfEntriesToRead = applyMaxSizeCap(maxEntries, maxSizeBytes);

if (hasMoreEntries()) {
if (hasMoreEntries() && maxPosition.compareTo(readPosition) >= 0) {
// If we have available entries, we can read them immediately
if (log.isDebugEnabled()) {
log.debug("[{}] [{}] Read entries immediately", ledger.getName(), name);
Expand Down

0 comments on commit c29f36a

Please sign in to comment.