Improve beginMasterChanges and make methods for DeferredUpdates
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 26 Aug 2016 07:19:34 +0000 (00:19 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 31 Aug 2016 23:34:39 +0000 (16:34 -0700)
commitf5a891fbe4459975520193ed635049ce0100f818
treec51efe7e99dca654f112765e57f9038628e9931d
parent1a812d498c9032a3d16a4f52e900e3563801513a
Improve beginMasterChanges and make methods for DeferredUpdates

* Fixed bug in LBFactory::beginMasterChanges where
  untracked DBs that then get written to where not in the
  transaction round. The call to onTransactionResolution()
  right after commit() was also problematic, so a flag was
  added to handle that.
* Add LBFactory::setWaitForReplicationListener(), which
  fires at what is often a good point to run deferred updates.
* Add DatabaseBase::clearSnapshot() for committing no-op
  transactions.
* Add IDatabase::setTransactionListener() for persistent
  callbacks. Monitoring commits can be used to find a point
  where deferred updates can run.
* Follow-up commit will address DeferredUpdates.

Change-Id: I4589e6f3ae40b1c362601416db48857fb89840bf
includes/db/DBConnRef.php
includes/db/Database.php
includes/db/IDatabase.php
includes/db/loadbalancer/LBFactory.php
includes/db/loadbalancer/LBFactoryMulti.php
includes/db/loadbalancer/LBFactorySimple.php
includes/db/loadbalancer/LoadBalancer.php
tests/phpunit/includes/db/DatabaseTest.php