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

ISPN-6706: Do not invoke CacheWriter.purge() if there is no eviction … #4373

Closed
wants to merge 1 commit into from

Conversation

ksobolew
Copy link

…and the writer has preload enabled.

The thinking behind this is that when these two conditions are met, the cache
store's state is expected to be an exact copy of the transient state, and
purging the store itself is redundant: since the transient state is expected to
be the same as the persistent state, the entry will be removed from the store
IFF it is removed from the transient state.

Caveat: manual calls to evict() will break this assumption.

…and the writer has preload enabled.

The thinking behind this is that when these two conditions are met, the cache
store's state is expected to be an exact copy of the transient state, and
purging the store itself is redundant: since the transient state is expected to
be the same as the persistent state, the entry will be removed from the store
IFF it is removed from the transient state.

Caveat: manual calls to evict() will break this assumption.
@wburns
Copy link
Member

wburns commented May 25, 2016

@ksobolew Unfortunately, CacheWriter purge isn't related to eviction. This is to remove entries that have expired [1]. Expiration can be configured both via xml and inserted programatically. Due to the latter we have to always call the purge method. It is feasible to keep state on the writer such as a boolean to trigger if any entry has ever been able to expire and it not then skip purge.

I am closing this PR, however if you wanted to possibly add the previous optimization we could field that. Also if you wanted to suggest a change we could discuss it on the dev mailing list. Info can be found at [2]

[1] http://infinispan.org/docs/9.0.x/user_guide/user_guide.html#_difference_between_eviction_and_expiration
[2] https://lists.jboss.org/mailman/listinfo/infinispan-dev

@wburns wburns closed this May 25, 2016
@ksobolew
Copy link
Author

I answered in the ISPN-6706 JIRA

@wburns
Copy link
Member

wburns commented May 25, 2016

@ksobolew thanks, moved discussion to there.

@wburns
Copy link
Member

wburns commented May 25, 2016

Although I do like the creativity with the optimization 👍

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