Edgewall Software

Changes between Version 6 and Version 7 of TracDev/Proposals/CacheInvalidation


Ignore:
Timestamp:
Mar 16, 2009, 7:13:58 PM (15 years ago)
Author:
Christian Boos
Comment:

feedback on prototype implementation of idea 2

Legend:

Unmodified
Added
Removed
Modified
  • TracDev/Proposals/CacheInvalidation

    v6 v7  
     1[[PageOutline(2-4)]]
    12= The problem of cache invalidation =
    23
     
    9697 * Two new `trac-admin` commands allow listing the `cache` table and invalidating one or more caches. They are intended for debugging purposes, and should probably be removed if the proposal is applied to trunk.
    9798
     99=== Discussion ===
    98100'''Comments and testing are very welcome'''. The implementation is quite complete, except for the missing database upgrade module. I have only tested with several concurrent `tracd` instances so far.
    99101
     102==== cboos' feedback ====
     103It's really nice, I like it a lot!
     104
     105When reviewing the code, I think I've detected some possible issues in `CacheManager.get`.
     106 - in case there are multiple "out-of-date" threads, each might trigger a retrieval. An improvement would be to check if the `CacheManager` already has a "newer" generation.
     107 - in the locked section, if the generation increases after the cached value retrieval and before the fetch of the latest generation, the `CacheManager` may think it is up to date yet have old data.
     108Those are admittedly corner cases, I hope I have not missed more important issues while focusing on that ;-) See the first patch attachment:cache-manager_get-corner-cases.patch.
     109
     110Another little improvement I'd like to propose is to not have to bother with key names and let the decorators figure out the key from the method itself. See attachment:cache-manager-automatic-key.patch.
     111I've also added more documentation to the decorators and changed the order of the definitions in a top-down way (first the decorators, then the descriptors, ending with the proxy class), as I think it's easier to understand that way.
    100112
    101113== Idea 2: Cache control ==
     
    111123
    112124
    113 ==== Example: InterMapTxt cache ====
     125=== Example: InterMapTxt cache ===
    114126For convenience, if a Component only manages one cache (the common case), it can pass `self` instead of a string key and its class name will be used.
    115127