ClearMessageBlobs uses TRUNCATE TABLE in a tight loop:
foreach ( $wgConf->getLocalDatabases() as $wiki ) { $lb = wfGetLB( $wiki ); $db = $lb->getConnection( DB_MASTER, array(), $wiki ); $db->query( "TRUNCATE TABLE " . $db->tableName( 'msg_resource' ), __METHOD__ ); $db->query( "TRUNCATE TABLE " . $db->tableName( 'msg_resource_links' ), __METHOD__ ); $lb->reuseConnection( $db ); }
This results in a lot of replication slave lag on WMF production shards.
It should use a batched delete if possible, instead of truncate.
It should definitely check slave lag in the loop.