Made User generally use DB_SLAVE by default
authorAaron Schulz <aschulz@wikimedia.org>
Sun, 29 Mar 2015 01:01:27 +0000 (18:01 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Tue, 16 Jun 2015 15:29:06 +0000 (08:29 -0700)
commitdd42294d29953d07cf18191e75bacf4e5c029bcd
treef53e51bea435feffe242995d448793a4ff503755
parent8250d8f2b5513dd80c2b801f4899ad81cfa62644
Made User generally use DB_SLAVE by default

* By default, users will load from the slave unless
  the thread did a recent DB write. This is to handle
  changes within a request.
* ChronologyProtector should avoid staleness in common
  cases, and the CAS check on user_touched is a final
  barrier to block stale user object updates.
* Note that passwords are not cached, so they hit the
  DB when ever needed. Passwords now load from slaves
  when possible, instead of the master.
* This should get the code closer to handling user
  login and logged in users when the master is down.
* Fixed loadFromId() when READ_LOCKING is used.
* Also addressed TODO comment in load().

Bug: T92357
Change-Id: I0a8bdab720c19fe3fc2381799ae2e90ff09bb4cf
includes/User.php