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

WordPress Trac noreply at wordpress.org
Fri Nov 20 04:26:40 UTC 2015


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

Comment (by tollmanz):

 I'm looking into this and with some help from @rmmcue, I can reliably
 reproduce this locally. I've seen the results of this bug in production
 environments, but can now reproduce it locally. I want to document this
 here for when I forget and for others who venture into this place.

 Prerequisites:

 * Memcached installed and running
 * PECL Memcache installed (https://pecl.php.net/package/memcache)
 * Memcache object cache installed
 (https://wordpress.org/plugins/memcached/)

 1. Using WP CLI, insert an autoloading option

 {{{
 wp option add this-damn-bug drives-me-nuts
 }}}

 2. Open two terminal windows and use WP CLI to invoke a WP shell session
 in both

 {{{
 wp shell
 }}}

 3. In the first window, update the option:

 {{{
 update_option( 'this-damn-bug', 'is-fixed' );
 }}}

 4. In the second window, add another, unrelated option:

 {{{
 update_option( 'this-bug-sucks', 'really-hard' );
 }}}

 5. Close both WP shell sessions.
 6. Get the value of the original option:

 {{{
 wp option get this-damn-bug # Returns "drives-me-nuts"
 wp cache get alloptions options | grep this-damn-bug # Returns "drives-me-
 nuts"
 wp dq query
 mysql> SELECT option_value FROM wp_options WHERE option_name = 'this-damn-
 bug' LIMIT 1; # Returns "is-fixed"
 }}}

 The result is that the object cache is unchanged, yet the DB value is
 changed.

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


More information about the wp-trac mailing list