poorbarcode commented on code in PR #22221:
URL: https://github.com/apache/pulsar/pull/22221#discussion_r1606690986
##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/OpAddEntry.java:
##########
@@ -200,7 +210,7 @@ public void addComplete(int rc, final LedgerHandle lh, long
entryId, Object ctx)
lh == null ? -1 : lh.getId(), entryId, dataLength, rc);
}
- if (rc != BKException.Code.OK) {
+ if (rc != BKException.Code.OK || timeoutTriggered.get()) {
Review Comment:
1. Create ledger `1`, create a new `currentLedgerTimeoutTriggered`(we call
it `Bol_1`)
2. `OpAddEntry_1` related to `Bol_1`
3. `OpAddEntry_2` related to `Bol_1`
4. `OpAddEntry_3` related to `Bol_1`
--- `OpAddEntry_2` timeout after the `OpAddEntry_1` is completed ---
5. Set `Bol_1` to `timeouted`.
6. Create new ledger `2`, create a new `currentLedgerTimeoutTriggered`(we
call it `Bol_2`)
7. Copy `2` entries in the pending add queue
a. `OpAddEntry_2_copied` related to `Bol_2`
b `OpAddEntry_3_copied` related to `Bol_2`
---
Answer:
`OpAddEntry_2` and `OpAddEntry_2_copied` are not the same object, and they
relate to different `currentLedgerTimeoutTriggered`.
- If `OpAddEntry_3` completes after step `7`, since `OpAddEntry_2` relates
to `Bol_1 (timeouted)`, it will not be completed.
- If `OpAddEntry_3` completes after step `6` and before step `7`, since
`OpAddEntry_2` relates to `Bol_1 (timeouted)`, it will not be completed.
--
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]