-
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
…24941) In the current implementation of Hazelcast, evictions are not replicated over WAN to target clusters - this is done intentionally as evictions are purely local operations that usually occur as a last resort to free resources on demand. However, there are circumstances where some users may want to have evictions replicated over WAN to try and maintain more synchronization between 2 clusters (even though this does still not guarantee data consistency using WAN). This commit introduces 2 new `ClusterProperty` entries that allow WAN replication of `IMap` and `ICache` eviction events respectively. This property is disabled by default and must be explicitly enabled as WAN replication of eviction events was purposefully omitted prior to this. Code changes are simple, introducing `publishWanRemove()` calls within `DefaultRecordStore` (for `IMap`) and `AbstractCacheRecordStore` (for `ICache`) - I had originally trialed a solution that introduced these calls within operations (`EvictOperation` etc) to match existing WAN replication mechanics, but due to the mostly-local nature of eviction that is often triggered as a result of other operations (not eviction operations directly), it made more sense to implement at the root of eviction calls, which resides in these record stores. This solution, when enabled, fires WAN replication events for all evictions (expiration, resource constraints, user-invoked, etc) - the reason for this is the use-case for these config options is to attempt to keep data more consistent between 2 clusters over WAN, and so in this scenario (although still not bulletproof by any means), it makes sense to try and replicate all operations that result in mutation (as is the case with all evictions). This commit also includes a regression test that confirms consistency between 2 clusters under ideal circumstances with evictions on the source cluster. Fixes https://hazelcast.atlassian.net/browse/HZ-2619 EE PR: hazelcast/hazelcast-enterprise#6201
- Loading branch information
1 parent
1ee1e1a
commit c5f4a6f
Showing
3 changed files
with
63 additions
and
0 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