Repository navigation
ARTEMIS-6362 A send refused after its duplicate id check leaves the duplicate id cache as it was - #6883
ARTEMIS-6362 A send refused after its duplicate id check leaves the duplicate id cache as it was#6883grepjava wants to merge 1 commit into
Conversation
…uplicate id cache as it was
|
I see... this is where the duplicate came from? |
|
Not quite, this one is a separate path. Here the problem is the slot an ID overwrites, not an ID held twice. A send outside a transaction put its ID in the cache straight away, overwriting the oldest slot of a full cache. If routing then failed (an address full under |
|
FYI #6904 (ARTEMIS-6366) builds on this one: it holds a transaction's ids in the same in-flight count from its prepare or commit. I'll rebase it once this is merged. |
For a send outside a transaction,
PostOfficeImpl.checkNotBridgeDuplicateIDstarts a transaction and callsaddToCache(duplID, tx, true), which put the id in the cache at once, overwriting the oldest slot of a full cache, and registered anAddDuplicateIDOperationthat deleted the new id on rollback. When routing then failed (an address full underFAIL, say), the rollback took the new id out, but the id it had overwritten was gone: sending that older message again was delivered.Both caches now keep such an id aside, in a count of ids in flight that
containsalso checks, so a concurrent send of it is still a duplicate. It takes its slot inbeforeCommit, once the send was routed, and a rollback just releases it, so a send that fails leaves the cache as it was. The bridge'satomicVerifygoes the same way.DuplicateDetectionTest.testRefusedSendKeepsTheIdBeforeItuses an address withid-cache-size1 andFAIL: "d1" is accepted, the address is filled, "d2" is refused, and once the queue is drained "d1" sent again must be dropped as a duplicate. It fails without the fix.https://issues.apache.org/jira/browse/ARTEMIS-6362