[Mondrian] SegmentCache: getSegmentHeaders and cache content synchronization

Julian Hyde jhyde at pentaho.com
Wed Apr 11 17:05:58 EDT 2012


On Apr 11, 2012, at 7:06 AM, Tiago Ferreira wrote:

> We have a SegmentCache implementation on top of Hazelcast, but mondrian doesn't seem to take into account what's actually in it.
> If we restart pentaho leaving the cache running, repeating an already cached query always results in a put. Also, if a cached segment is directly removed from hazelcast, mondrian keeps attempting to get it from cache without a put.
> 
> getSegmentHeaders is implemented in our cache, but it is never called. Looking at the source I could only find references to the method in SegmentCacheWorker and SegmentCache implementations (CompositeSegmentCache, MemorySegmentCache), it doesn't seem to be called at all.

These look like genuine issues.

I can see that SegmentCache.getSegmentHeaders() is only called from SegmentCacheWorker.getSegmentHeaders(), but no code calls that. These should be some event where mondrian queries the content of the cache. Maybe that event is where mondrian joins a cache; also, perhaps it should re-sync with the cache if it has received a lot of errors and/or a particular amount of time has elapsed.

What does hazelcast return if a segment is removed? Does it return null or an error? In either case, mondrian should remove the segment from its index, so it doesn't ask again.

Tiago, please file a jira case for these issues.

Julian



More information about the Mondrian mailing list