Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Writes to a persistent map store may be lost when coalescing is turned on. #18670

Closed
palisie opened this issue May 12, 2021 · 3 comments · Fixed by #18686
Closed

Writes to a persistent map store may be lost when coalescing is turned on. #18670

palisie opened this issue May 12, 2021 · 3 comments · Fixed by #18686
Assignees
Labels
Module: IMap Source: Community PR or issue was opened by a community user Team: Core Type: Defect
Milestone

Comments

@palisie
Copy link
Contributor

palisie commented May 12, 2021

It is a continuation of issue #15060.
Correction of this issue used sequence number of DelayedEntry to detect a situation when at the time of removing already persisted DelayedEntries there is already a newer DelayedEntry.
But there is still a small window when sequence number is not yet initialized but the DelayedEntry has already been added to the queue. See WriteBehindStore::add() @ version 4.1.1

public void add(DelayedEntry<Data, Object> delayedEntry) {
        writeBehindQueue.addLast(delayedEntry, false);

        stagingArea.put(delayedEntry.getKey(), delayedEntry);

        delayedEntry.setSequence(sequence.incrementAndGet());
    }

We are still observing occasional lost updates and we think this is the reason. Under normal circumstances the issue reproduces very rarely. To increase chances of reproduction it is needed to increase frequency of StoreWorker runs.

Attached a diagram of the problematic mechanism
image

Attached a test case. Contains a modified StoreWorker to increase chance of reproduction.
CoalescedSequenceTest.zip

@nfrankel
Copy link
Contributor

Just barging in to to thank you for all the diagnostics data @palisie. Great job!

@Holmistr
Copy link
Contributor

Holmistr commented May 12, 2021

Hi @palisie , thanks a lot for the report and a nice description. @ahmetmircik will take a look at this issue as he's the expert on the MapLoader stuff but he's on vacation this week, so please bear with us :)

@mmedenjak mmedenjak added Module: IMap Source: Community PR or issue was opened by a community user Team: Core labels May 12, 2021
@palisie
Copy link
Contributor Author

palisie commented May 13, 2021

I'm adding a corrected version of the test case. Added a wait time after changing the items in cache to allow writes to finish and eliminate any false positives.
CoalescedSequenceTest-2.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Module: IMap Source: Community PR or issue was opened by a community user Team: Core Type: Defect
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants