Cache not updated after clean

Not applicable

If I call InvalidateCache policy before calling PopulateCache policy for the same cache key - I'm not always able to retrieve cache's new value. Two revisions of proxy attached: rev3 doesn't call InvalidateCache policy and it works fine, rev4 calls InvalidateCache before PopulateCache policy and if I try to get cache's new value - sometimes I get it and sometimes it is empty. Why is this happening? Is it related to some problems with message processors?

max-test-rev3-2016-06-29.zip

max-test-rev4-2016-06-29.zip

Trace results: In trace for rev4 3rd and 4th POST request for /retrieve operation get no data from cache after I've populated cache with new value.

traces.zip

We had an issue with cache updating by PopulateCache policy that has been fixed allready so InvalidateCache policy problem is the only left.

1 7 181
7 REPLIES 7

@MSaichuk,

Thanks for opening this new thread. I have been able to reproduce the issue at my end. I will investigate the issue and update.

Not applicable

Remember that caches are eventually consistent. If in call 1 you invalidate an entry or insert an new entry into the cache, an immediate call 2 - which may route to a different MP - may not yet be consistent with the changes from call 1. If the key/value added to the cache is new - a call to the object cache may return empty if the key/value pair has not yet propagated to the MP serving call 2.

There is no hard and fast rule as to how soon the cache becomes consistent and you should design your proxies with the idea that the cache may NOT ever become consistent. As well, cache may arbitrarily (to us mere humans at least) eject entries from the cache when the MP comes under memory pressure.

Finally, don't rely on cache to propagate configuration values. KVM is more appropriate for these kinds of scenarios.

Thanks for your answer.

I would like to clarify the case where we perform InvalidateCache and PopulateCache operations in single request flow. Is it possible that these operations are performed on different MP? May it cause the situation when we populate new value and clean it after for our case?

@MSaichuk,

The InvalidateCache and PopulateCache policies are happening in a single API request, so both these operations will get executed on the same MP.

I see the trace files, will review...

The subsequent read is however a separate request isn't it?

Not applicable

Thanks for your answer.

I would like to clarify the case where we perform InvalidateCache and PopulateCache operations in single request flow. Is it possible that these operations are performed on different MP? May it cause the situation when we populate new value and clean it after for our case?