[wp-trac] [WordPress Trac] #23448: Passive invalidation via last_changed should use timestamps

WordPress Trac noreply at wordpress.org
Mon Feb 11 12:20:57 UTC 2013


#23448: Passive invalidation via last_changed should use timestamps
-------------------------+--------------------------
 Reporter:  westi        |       Type:  defect (bug)
   Status:  new          |   Priority:  high
Milestone:  3.6          |  Component:  Cache
  Version:  trunk        |   Severity:  major
 Keywords:  needs-patch  |
-------------------------+--------------------------
 For #23173 we are switching lots of things over to passive invalidation
 via cache incrementors and last_changed.

 This includes switching the oldest thing we had using this method of
 invalidation over to using {{{wp_cache_incr}}}.

 This ticket is a petition to use {{{time()}}} still as the initial value
 so as to avoid race conditions with cache evictions and cache
 incrementors.

 Currently with a 1 based last_changed key the following is possible with a
 persistent object cache backend like memcache:

  * last_changed is set to 1
  * list of pages is cached with 2 pages being the result of a get_pages
 call
  * last_changed is evicted from the memcache server
  * Another page is added
  * A call to get_pages happens, sets last_changed to 1 and returns the old
 data

 Confusion the reigns for a bit until other things are evicted or another
 change is made.

 If we start with {{{last_changed = time()}}} then we have no danger of
 using stale cache entries.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23448>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list