Commit graph

80 commits

Author SHA1 Message Date
Aaron Schulz
de0e9f09c5 Fixed mismatched profile calls in LoadBalancer.
Change-Id: I1ac81347b8af9b30dc03df94a76483a4ae4a6503
2012-09-29 11:52:48 -07:00
Aaron
522820ccaa Don't send COMMIT if not in a transaction.
Change-Id: Ifffbf703b15cd875feda1514d3c0d488b8665b66
2012-09-21 15:27:10 -07:00
Alexandre Emsenhuber
7525820cb7 Remove some debug output when opening a new database connection
Simplified the messages to avoid duplicates.

Change-Id: Ibcccc98bc18bdd0e0b876d9ad97f281c643eeabf
2012-09-18 14:01:02 +00:00
Alexandre Emsenhuber
78a56a67ba Added missing GPLv2 headers in includes/db.
Change-Id: Ib8fe301c6db77603e411113cea5a39c25c664961
2012-04-26 10:47:10 +02:00
Alexandre Emsenhuber
d97561461c Pass __METHOD__ to DatabaseBase::begin(), DatabaseBase::commit() and DatabaseBase::rollback() 2012-02-25 13:23:43 +00:00
Antoine Musso
73247df204 Remove backslash from @return types
Ping r111103
2012-02-13 16:35:59 +00:00
Sam Reed
c052fc3b7b Documentation followups from lastnight 2012-02-10 15:37:33 +00:00
Sam Reed
e1d83d5721 Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 18:01:54 +00:00
Alexandre Emsenhuber
d109eae77f Pass some more __METHOD__ to DatabaseBase::begin() and DatabaseBase::commit() 2012-01-18 12:10:16 +00:00
Jeroen De Dauw
49cdca93be add missing deprecation notices and added deprecation version to existing ones 2011-12-13 05:19:05 +00:00
Sam Reed
5bfce03820 More documentation of parameters following up r104591 2011-12-05 16:50:58 +00:00
Sam Reed
39356de1a4 Moar documentations 2011-11-29 21:04:20 +00:00
Sam Reed
27665d27ae Update some deprecated code
Documentation

Fix "/*" comments to "/**"

Flesh out some missing returns, change some return types
2011-10-14 21:18:38 +00:00
Sam Reed
4d8c6dee24 Moar documentations 2011-09-16 17:58:50 +00:00
Sam Reed
e960fc9b39 Merge r90266 to trunk
Fixes fixme on r75341, r75343
2011-09-07 23:21:41 +00:00
Tim Starling
23f8346ce7 Further updates for r90643/r95647 in core and extensions. Fixed all callers of Database::getLag(), made them call a new function LoadBalancer::safeGetLag() instead, which doesn't cause fatal errors for non-replicated installations. The core updates are tested but the extension updates aren't. 2011-08-29 05:04:55 +00:00
Tim Starling
a3bf5ecb4a * Fix for r90643: in the case where there is only one server, implying no replication, make LoadBalancer::getLagTimes(), LoadMonitor_MySQL::getLagTimes() and LoadBalancer::getMaxLag() quickly report zero lag without attempting to do a SHOW SLAVE STATUS query.
* Updated the documentation to make it clear that REPLICATION CLIENT is required in a replicated setup. 
* Reverted r90773.
2011-08-29 04:42:26 +00:00
Sam Reed
8712062c94 Fix documentation (clearing w/c) 2011-08-24 12:47:42 +00:00
Sam Reed
7a06cb7d58 Add in \n from/to r95055 to LoadBalancer.php
Differentiate error messages from r95050 per Hashar
2011-08-21 15:24:44 +00:00
Sam Reed
5a2afad3b0 Upstream wikia changes 2011-08-19 23:19:26 +00:00
Chad Horohoe
498213cc9f Merge live hack - Extra debugging on connection failures 2011-08-01 23:28:06 +00:00
Tim Starling
0e73205470 General database-related code cleanup:
* 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.
2011-06-23 03:14:11 +00:00
Tim Starling
8371ede86b Fixes for r80864 for 1.18 backport:
* Use camel case in tableName and dbName, dontrunallyourwordstogetherlikethis
* Call the function factory() instead of newFromType(), for consistency with the rest of MediaWiki
2011-06-20 07:00:50 +00:00
Sam Reed
4ffe712c84 Fix trailing whitespace 2011-06-17 15:59:55 +00:00
Sam Reed
fe611d4dc6 * (bug 29267) always give the servername for meta=siteinfo&siprop=dbrepllag 2011-06-03 22:59:34 +00:00
Sam Reed
2b676156ba And even more documentation 2011-05-28 18:58:51 +00:00
Sam Reed
6fac268c19 Documentation 2011-05-25 18:41:31 +00:00
Sam Reed
33ad682ab0 Add/remove/tweak method documentation 2011-05-19 00:03:31 +00:00
Siebrand Mazeland
75c6696aa8 Use consistent notation for "@todo FIXME". Should update http://svn.wikimedia.org/doc/todo.html nicely. 2011-05-17 22:03:20 +00:00
Brian Wolff
fb1c2b7d26 Follow up r86363 - Missing a dollar sign.
Fixes the: Notice: Use of undefined constant i - assumed 'i' in /var/www/w/phase3/includes/db/LoadBalancer.php on line 745
2011-05-02 07:42:14 +00:00
Alexandre Emsenhuber
e7660a8654 * Changed wfMsgNoDBForContent() call to wfMessage(); also switched to user's language, I don't see any reason to not display this in user's language
* Marked wfMsgNoDBForContent() as deprecated and added wfDeprecated() call; the call in LoadBalancer was the only one in core and extensions
* Also added call to wfDeprecated() in wfMsgWeirdKey(); no call in core or extensions
2011-04-19 06:21:06 +00:00
Sam Reed
cdf75379c9 Apply LoadBalancer related fixes
Patches by Yuvi Panda

From (bug 28583) Remove all /* private */ declarations in MediaWiki core
2011-04-18 23:12:58 +00:00
Sam Reed
01891953bc More function/member variable documentation 2011-03-09 17:09:10 +00:00
Sam Reed
e30476fd0c Followup r83558, r83555
Set default of false to $open parameter
2011-03-09 16:37:39 +00:00
Roan Kattouw
c4bcbc22c9 Merge r83555 from 1.17wmf1: fix wait for slaves code from r83529 2011-03-09 00:24:21 +00:00
Roan Kattouw
ff6fec1e6f Make updateCollation.php a bit less murderous for WMF databases:
* Don't run a COUNT(*) query on what's potentially the entire categorylinks table on enwiki (hundreds of millions of rows). Put it in a miser mode check
* Wait for DB replication to catch up before processing the next batch. Implemented LoadBalancer::waitAll() for this purpose, which should behave more nicely than wfWaitForSlaves()
2011-03-08 16:47:26 +00:00
Platonides
49074e8a56 Yet more additions of wfProfileOut() 2011-02-10 16:39:53 +00:00
Alexandre Emsenhuber
c2379cd884 Fix for r80864: the $dbname variable was not there only to make pretty debug output, but also to let the connection choose the correct database. This was breaking connections to other databases since they were always using wiki's database. 2011-01-24 18:45:59 +00:00
Chad Horohoe
b3e99eec5b Followup to r79848 (and really, make it useful...)
Turn DatabaseBase::classFromType() into newFromType() factory function for constructing a new object based on a given type and (optional) params. Documented it fairly clearly.

I think it looks nicer :)
2011-01-24 16:31:36 +00:00
Sam Reed
bb29dc588d (bug 26895) in /include/db/LoadBalancer.php function "closeConnecton" should be called "closeConnection"
Seemingly no callers in extensions OR phase3 (weird...), searching for "closeConnecton" or the correctly spelt "closeConnection"

The back-compat typo thing probably wants removing.. Seems to have been as such since it was added in r32578...
2011-01-24 01:00:29 +00:00
Chad Horohoe
97b62e3034 Add DatabaseBase::classFromType() to reduce the 'Database' . $type duplication 2011-01-07 22:32:52 +00:00
Alexandre Emsenhuber
54b82541b4 Fix for r79231: $dbname was missing 2010-12-30 07:24:41 +00:00
Sam Reed
8180764a47 Extract sucks
Wrap long line
2010-12-30 02:48:27 +00:00
Roan Kattouw
e9f29660a8 Fix bug in load balancer: filter out non-replicating slaves (or slaves otherwise not reporting their lag) even if no max lag is specified 2010-11-27 22:39:56 +00:00
Roan Kattouw
ebd644480f Fix typo in LoadBalancer.php 2010-11-27 22:36:05 +00:00
Chad Horohoe
ae0df98c32 rm unused and (seemingly) broken factory function 2010-11-23 16:11:28 +00:00
Max Semenik
64089af28a Removed LoadBalancer::getGroupIndex(): deprecated since r32578, no callers 2010-11-23 12:27:02 +00:00
Sam Reed
d189aaee05 (bug 24853) Kill failFunction - Fixed! :D 2010-10-24 21:27:33 +00:00
Sam Reed
16cded8b32 Start of bug 24853, killing off 'functional' parts of failfunction code. Seems when the constructors start getting changed, it starts borking. Using this as a point of reversion/stashing 2010-10-24 20:48:48 +00:00
Antoine Musso
478768939c Follow up r74962, debug messages should be splitted.
This is to avoid log mess with concurrent accesses and to allow logging between the messages.

Makes the message more readeable:
  Connecting to localhost wikidb...
  Connected to localhost wikidb.
  Connection failed to localhost wikidb.
2010-10-19 06:27:25 +00:00