[Database] Fixed case where trx idle callbacks might be lost.
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 14 Nov 2012 19:40:36 +0000 (11:40 -0800)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 16 Nov 2012 02:45:17 +0000 (02:45 +0000)
commit33eb67af1d7ca97bca43941f0b4a4fa584c5343d
tree7e977c0409eb3b499ccb9b11c9977118e49fe471
parent3fca064bfc61ae0579bbeea33fa1daeccc5dadc7
[Database] Fixed case where trx idle callbacks might be lost.

* (bug 41656) LoadBalancer always commits if there are callbacks pending.
  This works by checking a new DatabaseBase::writesOrCallbacksPending() function.
* Made transaction idle callbacks run in autocommit mode. Generally callers already
  want autocommit mode or do quick begin()/commit() calls anyway. The docs already
  make stat that callbacks should close any connections they start, but this makes
  it harder for people to forget about implicit transactions. Since the callbacks
  often may happen in commitMasterChanges(), if transactions are left open, they
  might not get committed by anything afterwards.
* Added sanity exceptions and warnings if callbacks get lost for some reason.
* Renamed trxIdleCallbacks -> mTrxIdleCallbacks for consistency.

Change-Id: I00e1e0fcdd7deeee1fbac6d0f295160479cb8962
includes/db/Database.php
includes/db/LoadBalancer.php