diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2013-01-18 16:46:04 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2013-01-18 16:46:04 +0100 |
commit | 63601400e476c6cf43d985f3e7b9864681695ed4 (patch) | |
tree | f7846203a952e38aaf66989d0a4702779f549962 /maintenance/fixSlaveDesync.php | |
parent | 8ff01378c9e0207f9169b81966a51def645b6a51 (diff) |
Update to MediaWiki 1.20.2
this update includes:
* adjusted Arch Linux skin
* updated FluxBBAuthPlugin
* patch for https://bugzilla.wikimedia.org/show_bug.cgi?id=44024
Diffstat (limited to 'maintenance/fixSlaveDesync.php')
-rw-r--r-- | maintenance/fixSlaveDesync.php | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/maintenance/fixSlaveDesync.php b/maintenance/fixSlaveDesync.php index 3c6888ae..8bf556f0 100644 --- a/maintenance/fixSlaveDesync.php +++ b/maintenance/fixSlaveDesync.php @@ -1,5 +1,7 @@ <?php /** + * Fix erroneous page_latest values due to slave desynchronisation. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -15,11 +17,18 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * http://www.gnu.org/copyleft/gpl.html * + * @file * @ingroup Maintenance */ -require_once( dirname( __FILE__ ) . '/Maintenance.php' ); +require_once( __DIR__ . '/Maintenance.php' ); +/** + * Maintenance script that fixes erroneous page_latest values + * due to slave desynchronisation. + * + * @ingroup Maintenance + */ class FixSlaveDesync extends Maintenance { public function __construct() { parent::__construct(); @@ -88,7 +97,7 @@ class FixSlaveDesync extends Maintenance { private function desyncFixPage( $pageID ) { # Check for a corrupted page_latest $dbw = wfGetDB( DB_MASTER ); - $dbw->begin(); + $dbw->begin( __METHOD__ ); $realLatest = $dbw->selectField( 'page', 'page_latest', array( 'page_id' => $pageID ), __METHOD__, 'FOR UPDATE' ); # list( $masterFile, $masterPos ) = $dbw->getMasterPos(); @@ -98,7 +107,7 @@ class FixSlaveDesync extends Maintenance { /* if ( !$db->masterPosWait( $masterFile, $masterPos, 10 ) ) { $this->output( "Slave is too lagged, aborting\n" ); - $dbw->commit(); + $dbw->commit( __METHOD__ ); sleep(10); return; }*/ @@ -112,7 +121,7 @@ class FixSlaveDesync extends Maintenance { } if ( !$found ) { $this->output( "page_id $pageID seems fine\n" ); - $dbw->commit(); + $dbw->commit( __METHOD__ ); return; } @@ -199,7 +208,7 @@ class FixSlaveDesync extends Maintenance { } $this->output( "done\n" ); } - $dbw->commit(); + $dbw->commit( __METHOD__ ); } } |