[BACKPORT] Add system property to process WAN map remove events as delete #11178
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.
If the receiving cluster does not have a class defined in it's
classloader and uses the BINARY in-memory format, we can run into
ClassNotFoundException. The entry will be removed nevertheless but the
event processing will be flagged as failed and the ACTIVE cluster will
try and resend the WAN event. The second time it is sent, there
will be no entry with that key. This does not cause consistency
issues but performance issues since the WAN event operation is sent
twice.
We introduce a new system property to use delete instead of remove
when processing remove events. This will not avoid the
ClassNotFoundException since the delete operation does not try to
return the old value.
The system property is false by default, meaning it retains the old
behaviour unless explicitly set to true.
This new property also has the performance benefit that it does not
copy the old value from the partition owner. The WAN event processing
code does not use the returned value which makes the old value
unnecessary.
Fixes : https://github.com/hazelcast/hazelcast-enterprise/issues/1636
EE : https://github.com/hazelcast/hazelcast-enterprise/pull/1644