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

Prevent migration operations running before previous finalization completes v2 #16190

Merged

Conversation

mdogan
Copy link
Contributor

@mdogan mdogan commented Dec 5, 2019

If a node was the source of a backup replica migration
and then if it becomes the destination of another replica migration
on the same partition, MigrationOperation can be executed before
the former migration is finalized. Reason is, sources of backup migrations
are not part of migration transactions and they learn the migration
only while applying completed migrations.

Previously, when we detect this, we skipped the execution of previous
migrations finalization to prevent data loss. See #14834

But this may cause replica data leak, because of ignored finalization.

This time, migration finalizations are registered before
they are executed or enqueued. If there's an pending finalization
while a migration operation is being executed then migration operation
is rejected with a retryable exception.

Fixes #15562
Fixes #16066
Backport of #16189

…pletes v2

If a node was the source of a backup replica migration
and then if it becomes the destination of another replica migration
on the same partition, `MigrationOperation` can be executed before
the former migration is finalized. Reason is, sources of backup migrations
are not part of migration transactions and they learn the migration
only while applying completed migrations.

Previously, when we detect this, we skipped the execution of previous
migrations finalization to prevent data loss.

But this may cause replica data leak, because of ignored finalization.

This time, migration finalizations are registered before
they are executed or enqueued. If there's an pending finalization
while a migration operation is being executed then migration operation
is rejected with a retryable exception.
@mdogan mdogan merged commit 55a3b60 into hazelcast:maintenance-3.x Dec 9, 2019
@mdogan mdogan deleted the migration-finalization-race-x branch December 9, 2019 13:22
@mmedenjak mmedenjak added the Source: Internal PR or issue was opened by an employee label Apr 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants