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

WordPress Trac noreply at wordpress.org
Mon Nov 25 13:44:30 UTC 2019


#31245: Replace alloptions with a key cache
-------------------------------------------------+-------------------------
 Reporter:  rmccue                               |       Owner:
                                                 |  SergeyBiryukov
     Type:  enhancement                          |      Status:  closed
 Priority:  normal                               |   Milestone:  5.3.1
Component:  Options, Meta APIs                   |     Version:  2.1
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch needs-testing fixed-major  |     Focuses:
                                                 |  performance
-------------------------------------------------+-------------------------
Changes (by SergeyBiryukov):

 * status:  reviewing => closed
 * resolution:   => fixed


Comment:

 In [changeset:"46780" 46780]:
 {{{
 #!CommitTicketReference repository="" revision="46780"
 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.
 Merges [46753] and [46779] to the 5.3 branch.
 Fixes #31245.
 }}}

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


More information about the wp-trac mailing list