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

Custom expiry timeouts may not be replicated #108

Closed
brianoliver opened this issue Apr 23, 2014 · 6 comments
Closed

Custom expiry timeouts may not be replicated #108

brianoliver opened this issue Apr 23, 2014 · 6 comments

Comments

@brianoliver
Copy link
Contributor

Prior to an BinaryEntry being placed in the underlying Event Distribution framework custom decorations are removed. This unfortunately means DECO_EXPIRY may also be removed, which ultimately means any custom expiry time-outs on a BinaryEntry will be lost.

Instead of clearing/remove all custom decorations, we need to be a bit more selective, especially for DECO_EXPIRY. In the case of DECO_EXPIRY we need to do the following:

Prior to providing the BinaryEntry to the Event Distribution framework:

i). if the DECO_EXPIRY is NEVER or DEFAULT, leave it on the BinaryEntry.
ii). if the DECO_EXPIRY is a custom value, subtract Cluster time from the value and store that on the BinaryEntry (it should be >= 0).
iii). if the DECO_EXPIRY doesn't exist, ignore it.

Prior to updating the BinaryEntry on the remote site (see: com.oracle.coherence.patterns.eventdistribution.channels.cache.EntryEventProcessor):

i). get and remove the DECO_EXPIRY from the incoming BinaryEntry
ii). if the DECO_EXPIRY doesn't exist, ignore it.
iii). if the DECO_EXPIRY is NEVER or DEFAULT, call BinaryEntry.expire(...) using the specified value.
iv). if the DECO_EXPIRY is a custom value (>=0), add Cluster time to the value and then call BinaryEntry.expire(...)

Obviously we need to introduce new expiry-based tests for this improved functionality.

@brianoliver
Copy link
Contributor Author

Reported by @brianoliver

@brianoliver
Copy link
Contributor Author

@prbaal77 said:
Hi Brian. I am too facing the same issue i.e. not able to pass the expiry timeout. But i am little confused by your description.
The custom Expiry time set for a particular Entry by calling cache.put("key","value" TimeOutLong) is populated in BinaryEntry's expiryDelay field rather than decoration value DECO_EXPIRY. This expiry delay field is completely ignored in the publishingCachestore code hence never passed to other cluster.
I have tried writing my own custom logic, where in i am passing the expiry delay value as part of the decoration DECO_CUSTOM. Although it is not working properly, but i am able to send expiry data across.
Coherence version: 12.1.2-0-2
push-replication: 12.2.1-SNAPSHOT
Is there any other work around to tackle this issue?

@brianoliver
Copy link
Contributor Author

@brianoliver said:
When a you set the expiry of an entry, the binary representation of the entry becomes "decorated" with the expiry time. The binary entry, including the internal decorations, then passed through to the PublishingCacheStore (which is a BinaryEntryStore). However as part of the optimizations made in the PublishingCacheStore and to ensure incompatible decorations are not passed between clusters, we remove / ignore the decorations. Thus when the BinaryEntry (as part of the Distributable Event) arrives at a destination cluster (over a Distribution Channel), the decorations are no longer available or aren't used.

The fix is to take notice of the DECO_EXPIRY, including making allowances for the special "default" and "never" expire flags.

@brianoliver
Copy link
Contributor Author

@brianoliver said:
Resolved in Coherence Incubator 12.2.1-SNAPSHOT (develop-12 branch)
Resolved in Coherence Incubator 11.3.0-SNAPSHOT (develop-11 branch)
Resolved in Coherence Incubator 11.2.1-SNAPSHOT (release-11.2 branch)

@brianoliver
Copy link
Contributor Author

Marked as fixed by @brianoliver on Tuesday, September 2nd 2014, 12:52:16 pm

@brianoliver
Copy link
Contributor Author

This issue was imported from JIRA COHINC-108

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant