Ticket #901 (closed enhancement: fixed)

Opened 8 months ago

Last modified 7 months ago

Cleaner cache invalidation

Reported by: ronald Assigned to: pradeep
Priority: critical Milestone: 0.9.0
Component: ambra Version: 0.8.3-SNAPSHOT
Keywords: cache Cc:
Blocking: Blocked By:

Description (Last modified by jsuttor)

The cache-invalidation currently is very ad-hoc. We need a cleaner way to manage invalidations between caches. This is probably related to #900 in that we should create a cache-manager that encapsulates access to the caches and handles both things like transactions and invalidations.

Current page results caching & invalidation is very inefficient, see #278. Generation of a meaningful cache key for page results would allow the caching of pages for anonymous users, invalidation of single Article pages v. entire cache, etc.

Dependency Graph

Change History

04/04/08 13:43:43 changed by ronald

  • owner deleted.

04/05/08 14:51:05 changed by amit

  • owner set to pradeep.
  • priority changed from unassigned to critical.
  • blocking changed.
  • blockedby changed.

I talked with Rich and he agrees that we should go ahead and take the risk of cleaning this up now. Pradeep, I am assigning this as the base ticket. Please talk to Jeff as Rich believes he understands the cache infrastructure best from Ambra requirements.

04/07/08 15:53:52 changed by jsuttor

  • keywords set to cache.
  • description changed.

04/28/08 15:26:23 changed by pradeep

  • status changed from new to assigned.

05/01/08 18:26:17 changed by pradeep

(In [5575]) Added an Interceptor concept for OTM Sessions. This is similar to the Interceptor support provided by Hibernate.

This is to help Ambra resolve a number of tickets related to caching. Please see #900,#901,#829,#845,#861 (and may be more)

As part of this update, please note that the Transaction API has the following additions: 'isActive', 'wasCommitted' and 'wasRolledBack'.

05/01/08 19:18:38 changed by pradeep

(In [5576]) Basic infrastructure support for transactional cache updates and cache invalidations and also support for a journal context aware second-level cache (similar to Hibernate).

Addresses #900,#901,#829,#845,#861.

CacheManager? provides a READ_COMMITTED isolation level. Only cache that is managed by this CacheManager? now is the journal context aware object-cache for OTM. No changes to existing caches or cache-invalidations yet.

05/06/08 10:16:06 changed by pradeep

(In [5638]) Undo transaction related mods from r5575. No notice from OTM on transaction state changes. Apps can directly get that from JTA. (Also note that we might remove the local Transaction support completely from OTM and only support JTA transactions.)

So Ambra CacheManager? now registers a synchronization call-back directly from JTA. In addition there is now no assumption on the spring request-scope and transaction scope being the same. (I was being lazy - thanks Ronald)

Since we can't define them as spring transaction scoped beans (no such scope provider exist currently), the beans have been converted to singleton scope and the CacheManager? manages a transaction context internally for all the caches. (ugly but works).

Addresses #900, #901.

05/07/08 10:19:09 changed by pradeep

(In [5657]) Remove SimplePageCachingFilter? and its associated cache.

The object-cache now holds the blobs that this filter was caching. Moreover the object-cache is journal context aware and will be invalidated when article is deleted/re-ingested as well as when the journal membership changes.

This closes #740,#278 and addresses #610,#901.

05/07/08 12:23:33 changed by pradeep

(In [5659]) Remove Single-Annotation from article-annotation-cache. Object-cache contains this. Addresses #901.

05/07/08 16:19:04 changed by pradeep

(In [5669]) Make the old field values available in change notifications.

Addresses #901.

05/07/08 16:42:57 changed by pradeep

(In [5670]) Invalidate the annotation-list for an article in article-annotation-cache when an article is deleted or when any article-annotation that annotates that article has changed. Addresses #901.

05/07/08 16:57:25 changed by pradeep

(In [5671]) One more to the invalidation rule in r5670. The list in cache is maintained for article-annotations also, not just articles. Addresses #901.

05/07/08 17:40:11 changed by pradeep

(In [5675]) Invalidate citation cache entries in article-annotation-cache on an article delete. Addresses #901.

05/07/08 18:22:55 changed by pradeep

(In [5678]) Get rid of the cache entries for secondary objects and tables-and-figures from the article-annotation-cache. object-cache contains these already.

Addresses #901.

05/07/08 18:40:36 changed by pradeep

(In [5680]) Get rid of Article object from article-annotation cache. Already covered by object-cache. Also cleaned up the serialization hacks related to caching of the Article object. Addresses #901.

05/07/08 19:12:48 changed by pradeep

(In [5681]) Set up invalidations for transformed-article. Get rid of all manual invalidations. Addresses #901.

With this the article-annotation-cache related changes are complete. This cache only contains 3 types of entries now : annotation-list, transformed-article and citation-info. The citation-info should go away with #921.

05/09/08 03:03:41 changed by pradeep

(In [5689]) Convert journal and carrier cache into transactional cache. Also cache invalidations are based on change-listeners - instead of relying on manual notifications sprinkled all over.

As part of this change, Journal service has been split into three:

WARN: only tested on SingleBox? install.

Addresses #900, #901.

05/10/08 01:30:36 changed by pradeep

  • status changed from assigned to closed.
  • resolution set to fixed.

r5693 is the last of the changes. With this all notifications are tied to OTM.