require_once __DIR__ . '/backup.inc';
require_once __DIR__ . '/../includes/export/WikiExporter.php';
+use Wikimedia\Rdbms\LoadBalancer;
+
/**
* @ingroup Maintenance
*/
protected $checkpointFiles = [];
/**
- * @var DatabaseBase
+ * @var Database
*/
protected $db;
// We do /not/ retry upon failure, but delegate to encapsulating logic, to avoid
// individually retrying at different layers of code.
- // 1. The LoadBalancer.
try {
$this->lb = wfGetLBFactory()->newMainLB();
} catch ( Exception $e ) {
. " rotating DB failed to obtain new load balancer (" . $e->getMessage() . ")" );
}
- // 2. The Connection, through the load balancer.
try {
- $this->db = $this->lb->getConnection( DB_SLAVE, 'dump' );
+ $this->db = $this->lb->getConnection( DB_REPLICA, 'dump' );
} catch ( Exception $e ) {
throw new MWException( __METHOD__
. " rotating DB failed to obtain new database (" . $e->getMessage() . ")" );