* @see wfWaitForSlaves()
*/
+use Wikimedia\Rdbms\DBConnectionError;
+
require __DIR__ . '/../commandLine.inc';
if ( count( $args ) < 1 ) {
function checkIntegrity() {
echo "Doing integrity check...\n";
- $dbr = wfGetDB( DB_SLAVE );
+ $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%\' ' .
function getTextClause() {
if ( !$this->textClause ) {
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
$this->textClause = '';
foreach ( $this->clusters as $cluster ) {
if ( $this->textClause != '' ) {
*/
function trackRevisions() {
$dbw = wfGetDB( DB_MASTER );
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
$textClause = $this->getTextClause();
$startId = 0;
* archive table counts as orphan for our purposes.
*/
function trackOrphanText() {
- # Wait until the blob_tracking table is available in the slave
+ # Wait until the blob_tracking table is available in the replica DB
$dbw = wfGetDB( DB_MASTER );
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
$pos = $dbw->getMasterPos();
$dbr->masterPosWait( $pos, 100000 );
echo "Searching for orphan blobs in $cluster...\n";
$lb = wfGetLBFactory()->getExternalLB( $cluster );
try {
- $extDB = $lb->getConnection( DB_SLAVE );
+ $extDB = $lb->getConnection( DB_REPLICA );
} catch ( DBConnectionError $e ) {
if ( strpos( $e->error, 'Unknown database' ) !== false ) {
echo "No database on $cluster\n";