[wp-trac] [WordPress Trac] #31245: Replace alloptions with a key cache

WordPress Trac noreply at wordpress.org
Wed Nov 20 13:40:51 UTC 2019


#31245: Replace alloptions with a key cache
-------------------------------------+--------------------------
 Reporter:  rmccue                   |       Owner:  tellyworth
     Type:  enhancement              |      Status:  reviewing
 Priority:  normal                   |   Milestone:  5.4
Component:  Options, Meta APIs       |     Version:  2.1
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:  performance
-------------------------------------+--------------------------

Comment (by SergeyBiryukov):

 In [changeset:"46753" 46753]:
 {{{
 #!CommitTicketReference repository="" revision="46753"
 Options, Meta APIs: Avoid a race condition causing the first of two
 subsequent requests updating different options at the same time to lose
 changes.

 Every time an autoloaded option is updated or deleted, the `alloptions`
 cache is similarly updated. Due to the race condition, on any autoloaded
 option being updated, every other autoloaded option had its value set to
 the value at load time, causing a mismatch between the data in the
 persistent cache and the database.

 This change introduces a `$force_cache` parameter for
 `wp_load_alloptions()` to force an update of the local `alloptions` cache
 from the persistent cache when an option is added, updated, or deleted, to
 minimize the chance of affecting other options.

 Props fabifott, rmccue, tollmanz, johnjamesjacoby, spacedmonkey, dd32,
 jipmoors, tellyworth, jeremyclarke, joehoyle, boonebgorges,
 danielbachhuber, flixos90, jeichorn, mihdan, Grzegorz.Janoszka,
 SergeyBiryukov.
 See #31245.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/31245#comment:92>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list