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

[BACKPORT] Make reloading the owned partitions in map service context thread safe #11475

Merged

Conversation

mmedenjak
Copy link
Contributor

Since the migration finalizations can be called concurrently, the
owned partitions might be reloaded concurrently. This means that the
set of owned partitions first might be set to a newer version and
then to an older version, leading to an incorrect set of owned
partitions.
This affects the query engine when it performs queries off the
partition thread as every member reports its own set of owned
partitions which is in this case incorrect. If the results from the
actual partition owner are received by the query engine later than
from the "lying" partition owner, they are discarded. This can cause
the query engine to return incorrect results until the partitions are
reloaded again on an another migration.
The fix reloads the partitions in a CAS loop ensuring that the newest
partition state will always be applied.

Also, added some type parameters and improved javadoc.

Backport of: #11471

Fixes :
#10107
#9870
#10776

Since the migration finalizations can be called concurrently, the
owned partitions might be reloaded concurrently. This means that the
set of owned partitions first might be set to a newer version and
then to an older version, leading to an incorrect set of owned
partitions.
This affects the query engine when it performs queries off the
partition thread as every member reports its own set of owned
partitions which is in this case incorrect. If the results from the
actual partition owner are received by the query engine later than
from the "lying" partition owner, they are discarded. This can cause
the query engine to return incorrect results until the partitions are
reloaded again on an another migration.
The fix reloads the partitions in a CAS loop ensuring that the newest
partition state will always be applied.

Also, added some type parameters and improved javadoc.

Fixes :
hazelcast#10107
hazelcast#9870
hazelcast#10776
@mmedenjak
Copy link
Contributor Author

@mdogan @ahmetmircik I had to manually backport it since the classes changed a lot and the cherry pick failed with lots of conflicts. But it's mainly the same PR.

@mdogan mdogan merged commit 028d9a7 into hazelcast:maintenance-3.x Sep 28, 2017
@mmedenjak mmedenjak deleted the QueryBounceTest-failure-backport branch March 5, 2018 14:21
@mmedenjak mmedenjak added the Source: Internal PR or issue was opened by an employee label Apr 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants