sijie commented on a change in pull request #5942: Avoid using same OpAddEntry
between different ledger handles
URL: https://github.com/apache/pulsar/pull/5942#discussion_r362297588
##########
File path:
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
##########
@@ -1294,9 +1293,24 @@ public synchronized void updateLedgersIdsComplete(Stat
stat) {
log.debug("[{}] Resending {} pending messages", name,
pendingAddEntries.size());
}
+ // Avoid use same OpAddEntry between different ledger handle
+ int pendingSize = pendingAddEntries.size();
Review comment:
hmm, this doesn't seem to be correct to me. you need to preserve the order
when adding the newly created ops back to the queue.
what you need to do:
- drain the pendingAddEntries queue;
- create a new OpAddEntry for each entry
- add these ops into an intermediate list in the order of how they are
drained
- after the pendingAddEntries are drained, add the intermediate list back to
the pendingAddEntries queue.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services