-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…#25153) Backport of: #25114 After the introduction of these changes in December 2022 (#22942), it became possible for the `OnJoinRegistrationOperation` used in the `EventServiceImpl` to not be executed correctly across the cluster. This previous commit changed `EventServiceImpl#getPostJoinOperation` to return null permanently, replacing this functionality with an `OnJoinOp` passed for execution on the cluster's master by each joining member. This solution works under ideal circumstances of sequential cluster startup, however when several members try to join the master within `ClusterProperty#WAIT_SECONDS_BEFORE_JOIN` of startup, these joins are batched together - when a batched join occurs like this, currently only the "triggering" (final) member's `OnJoinOp` is executed, while all others are discarded. This results in registrations not being distributed across the cluster as expected, and can lead to inconsistent query results on Hazelcast. This commit aims to resolve this issue by storing all passed `OnJoinOp`s alongside their `MemberInfo`, mapped in `ClusterJoinManager` - this allows us to then execute _all_ passed `OnJoinOp`s within `ClusterJoinManager#startJoin`. This ensures registrations are not missed. I opted to use a `BiTuple` to store this operation rather than creating a `MemberInfo` extension to ensure we're not retaining the `OnJoinOp` object longer than necessary (which could happen if our extension is retained elsewhere), and since this operation only has value during the join process, and is only needed once. I also only broadcast these operations to members not included in the batched join itself, to avoid additional complexity. This commit also includes a regression test that focuses on the most prevalent method of observing this inconsistency - by examining `ProxyServiceImpl` registrations across a 6 member cluster where some non-master members start simultaneously, and others sequentially. Fixes https://hazelcast.atlassian.net/browse/HZ-2797
- Loading branch information
1 parent
b361a10
commit a593ca0
Showing
4 changed files
with
130 additions
and
58 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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