Added slave/master fallback logic in Revision
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 26 Mar 2015 00:29:31 +0000 (17:29 -0700)
committerOri.livneh <ori@wikimedia.org>
Tue, 31 Mar 2015 23:39:28 +0000 (23:39 +0000)
commit4d58457784386efffa508fd65e5914d76e0f797f
treec9289632c53cd2b70e4737e403bcbaff72522257
parent773c0d2c890b41b7883af751edb06fdd59b86015
Added slave/master fallback logic in Revision

* This is a more specific form of the logic removed in 3c2bc32ae1.
  It does not suffer the problem of causing constant master DB
  queries due to a bad template reference or such.
* It will use the master if writes from the current thread
  are pending or were recently committed. This deals with the
  common problem of code that needs to read things it just wrote,
  such as diffs on rollback or edit hooks.
* This commit reverts 8624e261f by making the hack obsolete.

Bug: T93866
Bug: T94407
Change-Id: Ib9ecb75e1236e767bdc86d124d5e22a03ae0fb5f
includes/Revision.php
includes/db/Database.php
includes/db/LoadBalancer.php
includes/diff/DifferenceEngine.php