[wp-trac] [WordPress Trac] #34304: get_and_update_post_meta for atomic post meta operations

WordPress Trac noreply at wordpress.org
Thu Oct 15 17:20:56 UTC 2015


#34304: get_and_update_post_meta for atomic post meta operations
-----------------------------+------------------------------
 Reporter:  lpghatguy        |       Owner:
     Type:  feature request  |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Database         |     Version:  trunk
 Severity:  normal           |  Resolution:
 Keywords:                   |     Focuses:
-----------------------------+------------------------------

Comment (by lpghatguy):

 Atomic operations on every type of data would be pretty rad.

 From what I can tell with the MySQL 5.0+ manuals, the named locking
 mechanisms (`GET_LOCK` and friends) are supported under all storage
 engines. They have the downside that you have to explicitly check them
 before writing to some data, which could create some overhead for every
 database read/write. I'd be interested to see just how big of a hit atomic
 read/write/update would cause.

 Actual table/row locks (eg `LOCK TABLE`) *do* seem to depend heavily on
 storage engine, and they'd certainly be a better solution in a controlled
 environment, but I don't think they'd be practical for WordPress in
 particular.

 MySQL tries to preserve full ACID compliance across shards, so I don't
 know how named locks are shared between multiple servers. It'd be worth
 looking into further, I imagine.

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


More information about the wp-trac mailing list