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
Add support for WAN replication of IMap/ICache evictions [HZ-2619] #24941
Merged
JamesHazelcast
merged 4 commits into
hazelcast:master
from
JamesHazelcast:fix/5.4/hz-2619
Jul 17, 2023
Merged
Add support for WAN replication of IMap/ICache evictions [HZ-2619] #24941
JamesHazelcast
merged 4 commits into
hazelcast:master
from
JamesHazelcast:fix/5.4/hz-2619
Jul 17, 2023
Conversation
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 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. This commit also includes a regression test that confirms consistency between 2 clusters under ideal circumstances with evictions on the source cluster. Full details regarding this PR can be found in HZ-2619 Fixes https://hazelcast.atlassian.net/browse/HZ-2619
JamesHazelcast
added
Type: Enhancement
Team: Core
Source: Internal
PR or issue was opened by an employee
Module: WAN
Add to Release Notes
labels
Jul 3, 2023
vbekiaris
approved these changes
Jul 7, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reminder to update documentation about the cluster properties and make sure it is clear all kinds of evictions (size- or expiration-driven and even manual evict
operations) will be replicated when this property is enabled.
ahmetmircik
reviewed
Jul 13, 2023
hazelcast/src/main/java/com/hazelcast/spi/properties/ClusterProperty.java
Show resolved
Hide resolved
Include information about expected use-case and considerations before enabling these options.
run-lab-run |
ahmetmircik
approved these changes
Jul 17, 2023
JamesHazelcast
added a commit
to JamesHazelcast/hz-docs
that referenced
this pull request
Jul 18, 2023
We recently added 2 new `ClusterProperty` entries for 5.4 related to the replication of eviction events with `IMap` and `ICache`. Relevant PR: hazelcast/hazelcast#24941
JamesHazelcast
added a commit
to JamesHazelcast/hazelcast
that referenced
this pull request
Jul 19, 2023
Backport of: hazelcast#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
JamesHazelcast
added a commit
that referenced
this pull request
Jul 21, 2023
…3.z] (#25039) Backport of: #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#6260
Serdaro
pushed a commit
to hazelcast/hz-docs
that referenced
this pull request
Aug 21, 2023
* Add WAN eviction cluster properties We recently added 2 new `ClusterProperty` entries for 5.4 related to the replication of eviction events with `IMap` and `ICache`. Relevant PR: hazelcast/hazelcast#24941 * Wording improvements Co-authored-by: angelasimms <106963942+angelasimms@users.noreply.github.com> * Add detailed docs for IMap/ICache eviction WAN replication * Feedback updates --------- Co-authored-by: angelasimms <106963942+angelasimms@users.noreply.github.com>
github-actions bot
pushed a commit
to hazelcast/hz-docs
that referenced
this pull request
Aug 21, 2023
* Add WAN eviction cluster properties We recently added 2 new `ClusterProperty` entries for 5.4 related to the replication of eviction events with `IMap` and `ICache`. Relevant PR: hazelcast/hazelcast#24941 * Wording improvements Co-authored-by: angelasimms <106963942+angelasimms@users.noreply.github.com> * Add detailed docs for IMap/ICache eviction WAN replication * Feedback updates --------- Co-authored-by: angelasimms <106963942+angelasimms@users.noreply.github.com> (cherry picked from commit aae86e2)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add to Release Notes
Module: WAN
Source: Internal
PR or issue was opened by an employee
Team: Core
Type: Enhancement
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 ofIMap
andICache
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 withinDefaultRecordStore
(forIMap
) andAbstractCacheRecordStore
(forICache
) - 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 evictionthat 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: https://github.com/hazelcast/hazelcast-enterprise/pull/6201