Commit graph

20 commits

Author SHA1 Message Date
Tim Starling
ea93933ee9 * Fixed complete breakage of "lag.php -r" due to spurious line-endings introduced in maintenance-work.
* Fixed breakage due to lag time cache, based on a hack in the WMF working copy.
* Tested locally.
2010-03-18 05:23:46 +00:00
Alexandre Emsenhuber
54fd0a4c1f Fixed some doxygen warnings 2010-03-11 20:59:25 +00:00
Roan Kattouw
af3fd687db Add $maxlag parameter to LoadBalancer::getMaxLag() so it'll actually select the right DB when opening new connections. Looks like an ugly temp fix to me but I have no idea how to do it properly offhand. 2010-01-05 23:39:16 +00:00
Chad Horohoe
b19e37425a Update callers from immediateCommit() to commit(). The former's been deprecated a really long time...Tim did it 45243 revisions ago. 2009-12-14 23:05:35 +00:00
Chad Horohoe
a4e5e935b6 Mass convert NULL -> null. Left strings and comments alone, obviously. 2009-12-11 21:07:27 +00:00
Tim Starling
bd8fffe24d Reverted r58646 as per my comments on bug 20554. 2009-12-01 01:55:04 +00:00
Roan Kattouw
1b89cd274a API: (bug 20554) Expose average slave lag (avglag) as well as maxlag. Patch by Sam Reed. 2009-11-06 14:38:55 +00:00
Tim Starling
8653947b06 * Skip COMMIT query when no write queries have been done.
* Improvement to ChronologyProtector: only record the master position if a write query was done. This should help to avoid the worst of the ChronologyProtector side-effects, such as having action=raw CSS requests block for a time equivalent to the slave lag on every page view, while maintaining the benefits, like preventing a 404 from being displayed after page creation.
2009-02-17 14:06:42 +00:00
Alexandre Emsenhuber
9b9636db03 Revert r41506 and make LoadBalancer::openForeignConnection() call Database::tablePrefix() on successful new connection 2008-10-13 18:38:01 +00:00
Tim Starling
90ed80443e (bug 12586) Use wfHostname() everywhere, remove $wguname and $wgNodeName. Use getenv('COMPUTERNAME') on Windows. 2008-10-06 07:30:38 +00:00
Alexandre Emsenhuber
ac1d1addfd Allow to specify per connection table prefix 2008-10-01 16:39:05 +00:00
Tim Starling
f1a352ccf9 * Revert revert r41234 of ES-related changes. The site_stats complaint should be fixed by the transaction added in r41287.
* Fix broken recursion guard in LoadBalancer::reportConnectionError(), which was causing getConnection() to return false on the second and subsequent errors, instead of throwing an exception. Revert incorrect fix r41229/r41230.
2008-09-28 01:42:55 +00:00
Brion Vibber
c4bbaf94c0 Revert some recent ES-related changes -- they made behavior much worse when we encountered problems with site_stats updates hanging and stacking up extra open ES connections.
r41230
r41229
r41093
r41091
r41092
r41086
r41063
r40696

Also reverted r41231 which no longer applies
2008-09-24 18:09:22 +00:00
Tim Starling
cf6c94e502 More specific error messages 2008-09-21 09:06:22 +00:00
Tim Starling
18e147f399 Logging tweaks 2008-09-21 08:28:21 +00:00
Tim Starling
cd8378a5a6 Revert/rewrite of r40696.
* We used to have parameters to ignore errors, but they're obsolete now that we have exceptions. Implemented ES master failover using exceptions instead. 
* Changing the number of DB connection attempts from 3 to 2 for some random getConnection() calls is almost pointless, adds lots of ugly formal parameters all of the place, and misses the big picture. It should be 2 by default, based on the original rationale. Any reasonable implementation of failover should have zero timeouts per request, by storing state. Changed the default to 2, or 1 if a long timeout is set.
2008-09-21 06:42:46 +00:00
Tim Starling
9b8782aaa8 Don't run hour-long, unlimited row-count DB queries with set_time_limit(0) in response to unauthenticated web requests on the master. Run them on the slave instead. Maybe we can crash the whole cluster instead of just a master or two.
Don't use DB_LAST, ever again.
2008-09-20 15:00:53 +00:00
Aaron Schulz
7b61c1972a ExternalStore tweaks:
* On read, spend less time checking on dead slaves
* Add randomInsert() to ES. This does the cluster picking for us
* Make revision text use randomInsert(). On write, fails-over to other clusters as needed instead of throwing db errors
2008-09-10 12:07:56 +00:00
Tim Starling
d6f0a95465 * Split off DB load monitoring logic into a LoadMonitor class hierarchy, to allow for plugins in this area.
* Use an associative array to initialise LoadBalancer objects
* By default, use Preprocessor_DOM if available, otherwise use Preprocessor_Hash. Preprocessor_Hash has worse performance.
* Fix parserTests.php for replicated databases. Use CREATE TABLE instead of CREATE TEMPORARY TABLE if there is more than one server configured.
* Log exceptions even in command-line mode.
2008-07-07 03:31:00 +00:00
Tim Starling
c6b902f180 * Reorganised the includes directory, creating subdirectories db, parser and specials
* Wrote a tool to check the integrity of the autoloader class list, fixed some issues that came up.
* Start the autoloader before LocalSettings.php, so that when an extension writer thinks an inefficient one-file special page extension is the way to go, they don't have to use explicit includes to make the class inheritance work. Should continue to work with $IP set in LocalSettings.php as long as $IP is set before extensions are included.
2008-06-16 20:21:26 +00:00
Renamed from includes/LoadBalancer.php (Browse further)