* @see wfWaitForSlaves()
*/
+use MediaWiki\MediaWikiServices;
+use Wikimedia\Rdbms\DBConnectionError;
+
require __DIR__ . '/../commandLine.inc';
if ( count( $args ) < 1 ) {
echo "Doing integrity check...\n";
$dbr = wfGetDB( DB_REPLICA );
- // Scan for HistoryBlobStub objects in the text table (bug 20757)
+ // Scan for HistoryBlobStub objects in the text table (T22757)
$exists = $dbr->selectField( 'text', 1,
'old_flags LIKE \'%object%\' AND old_flags NOT LIKE \'%external%\' ' .
exit( 1 );
}
- // Scan the archive table for HistoryBlobStub objects or external flags (bug 22624)
+ // Scan the archive table for HistoryBlobStub objects or external flags (T24624)
$flags = $dbr->selectField( 'archive', 'ar_flags',
'ar_flags LIKE \'%external%\' OR (' .
'ar_flags LIKE \'%object%\' ' .
$textClause = $this->getTextClause();
$startId = 0;
- $endId = $dbr->selectField( 'revision', 'MAX(rev_id)', false, __METHOD__ );
+ $endId = $dbr->selectField( 'revision', 'MAX(rev_id)', '', __METHOD__ );
$batchesDone = 0;
$rowsInserted = 0;
$textClause = $this->getTextClause( $this->clusters );
$startId = 0;
- $endId = $dbr->selectField( 'text', 'MAX(old_id)', false, __METHOD__ );
+ $endId = $dbr->selectField( 'text', 'MAX(old_id)', '', __METHOD__ );
$rowsInserted = 0;
$batchesDone = 0;
foreach ( $this->clusters as $cluster ) {
echo "Searching for orphan blobs in $cluster...\n";
- $lb = wfGetLBFactory()->getExternalLB( $cluster );
+ $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
+ $lb = $lbFactory->getExternalLB( $cluster );
try {
$extDB = $lb->getConnection( DB_REPLICA );
} catch ( DBConnectionError $e ) {
$startId = 0;
$batchesDone = 0;
$actualBlobs = gmp_init( 0 );
- $endId = $extDB->selectField( $table, 'MAX(blob_id)', false, __METHOD__ );
+ $endId = $extDB->selectField( $table, 'MAX(blob_id)', '', __METHOD__ );
// Build a bitmap of actual blob rows
while ( true ) {