The error was:
Catchable fatal error: Argument 1 passed to DatabaseMysql::masterPosWait()
must implement interface DBMasterPos, boolean given, called in
/var/www/DevWiki/core/includes/db/LoadBalancer.php on line 419
Change-Id: I230585930c1424b0868f9aa290167c66bc6848bd
We thought we'd fixed it previously, but the LB now connects to the
foreign slaves and tries to select $wgDBname. Fixing this by having
doWait() open connections that don't select any DB name, by passing
the empty string as the DB name. This is an undocumented feature
in the DatabaseMysql constructor, apparently.
Change-Id: Icc5594143a3eaa31170a7fc8c93d429c1a7dd575
* Refactored LoadBalancer::reportConnectionError()
* Removed PHP4-style reference from DatabaseError constructors
* Allowed to not pass a database to the DBError family of exceptions.
Change-Id: If9570b45ea7285de2b8b2391e704bc01f76be48a
Doxygen expects parameter types to come before the
parameter name in @param tags. Used a quick regex
to switch everything around where possible. This
only fixes cases where a primitve variable (or a
primitive followed by other types) is the variable
type. Other cases will need to be fixed manually.
Change-Id: Ic59fd20856eb0489d70f3469a56ebce0efb3db13
Added/removed spaces around logical/arithmetic operator
Reduced multiple empty lines to one empty line
Removed wrong tabs before comments at end of line
Removed too many spaces in assigments
Change-Id: I2bba4e72f9b5f88c53324d7b70e6042f1aad8f6b
Use it as if 'returning' a value for getConnection().
It doesn't make sense to sometimes add a return false and
sometimes not. But it was confusing that it looked like
wfProfileOut( __METHOD__ ); could be called twice.
Change-Id: I09638a134fcc925410389660f85239e8aa16483e
* (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
In the presence of DBO_TRX, commit() may be used like a "flush".
Added a flag to trigger this mode to commit() and changed DeferredUpdates
to used the flush mode.
Change-Id: I529117618194a2669535f3c5c0fed07588597299
This is a follow-up to Idbe4a903.
LoadBalancer::commitMasterChanges used to cause a warning if an implicite
transaction was in progress. This is now supressed.
Note that warnign when an automatic transaction is committed explicitely,
it does make sense to issue a warning. But that should not be done for summary
commits when closing a connection, etc.
Change-Id: Id68c3607f6b9d930c00422baa6658b0651f2e42e
* Merged the 4 simulated implementations of Database*::replace(). I took diffs, they were nearly identical. I made one based on the IBM DB2 version, since it used insert() which looked like a nice touch.
* Provided the non-simulated implementation of Database*::replace() via a protected member function, and made DatabaseMysql::replace() and DatabaseSqlite::replace() into a wrapper for it.
* Moved the MySQL-specific functionality from masterPosWait(), getSlavePos() and getMasterPos() from DatabaseBase to DatabaseMysql.
* Renamed getStatus() to getMysqlStatus() and moved it to DatabaseMysql. Removed "unimplemented" errors from two other subclasses. Really there's no way another DBMS could or should implement this function.
* Split the LoadMonitor class into a no-op class and a MySQL-specific class, to avoid fatal errors due to the getMysqlStatus() call if other DBMSs tried to use LoadBalancer with multiple servers. Of course there are lots of other reasons it won't work, I'm just fixing the architecture issue here.
And while I have a replicated test setup handy:
* On MySQL 4.1.9 and later, use SHOW SLAVE STATUS to get the lag instead of SHOW PROCESSLIST. This has the advantage of reading zero when there are no events for a while.
* Use camel case in tableName and dbName, dontrunallyourwordstogetherlikethis
* Call the function factory() instead of newFromType(), for consistency with the rest of MediaWiki