For maintenance scripts it is usually harmful to throw an exception. For jobs the exception was already caught and handled appropriately, so this can continue as before. For DeferredUpdates it was extremely harmful to throw an exception. So in the web case, reduce the timeout to 1s and continue as normal if the 1s timeout is reached. This allows the DeferredUpdate to be throttled without being killed. In the updater, increase the replication wait timeout to 5 minutes. ALTER TABLE could indeed cause replication lag, but exiting the update script with an exception will probably ruin your day. Update actions are not necessarily efficiently restartable. Do not call JobQueue::waitForBackups() when jobs are popped. Maybe it makes sense to call a queue-specific replication wait function for bulk inserts, like copyJobQueue.php, but doing it when jobs are popped just makes no sense. Surely the worst that could happen is that the queue would become locally empty? Removing this waitForBackups() call avoids waiting for replication twice when JobQueueDB is used. Bug: T201482 Change-Id: Ia820196caccf9c95007aea12175faf809800f084
35 lines
1.1 KiB
PHP
35 lines
1.1 KiB
PHP
<?php
|
|
/**
|
|
* 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
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License along
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
* http://www.gnu.org/copyleft/gpl.html
|
|
*
|
|
* @file
|
|
* @ingroup Database
|
|
*/
|
|
|
|
namespace Wikimedia\Rdbms;
|
|
|
|
/**
|
|
* Exception class for replica DB wait timeouts
|
|
* @deprecated since 1.32
|
|
* @ingroup Database
|
|
*/
|
|
class DBReplicationWaitError extends DBExpectedError {
|
|
}
|
|
|
|
/**
|
|
* @deprecated since 1.29
|
|
*/
|
|
class_alias( DBReplicationWaitError::class, 'DBReplicationWaitError' );
|