Repository navigation
Conversation
…duplicate until its newer slot is overwritten
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
InMemoryDuplicateIDCache.addToCacheInMemoryandPersistentDuplicateIDCache.addToCacheInMemoryput the new id in the map atpos, then removed the id of the slot they overwrote from the map, whichever slot the map pointed at. When that id was also held in a newer slot (one transaction sent it twice, ARTEMIS-6360, or two transactions that sent it both committed), the entry removed was the newer slot's, so the id stopped being a duplicate while the cache still held it. When the overwritten id was the new one (the same id added twice withid-cache-size1), the entry just put was removed.The overwritten id is now removed from the map only if the map still points at that slot, and the new id is put after it.
DuplicateDetectionUnitTest.testIdHeldTwiceInMemoryandtestIdHeldTwicePersistentadd "same" twice to a cache of 3, then "other" and "new", and check that "same" is still a duplicate, that it goes once its newer slot is overwritten, and that with a cache of 1 an id added twice stays. They fail without the fix.https://issues.apache.org/jira/browse/ARTEMIS-6361