ReplicationGui.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642
  1. <?php
  2. /**
  3. * Functions for the replication GUI
  4. */
  5. declare(strict_types=1);
  6. namespace PhpMyAdmin;
  7. use PhpMyAdmin\Query\Utilities;
  8. use function __;
  9. use function htmlspecialchars;
  10. use function in_array;
  11. use function mb_strrpos;
  12. use function mb_strtolower;
  13. use function mb_substr;
  14. use function sprintf;
  15. use function str_replace;
  16. use function strlen;
  17. use function strtok;
  18. use function time;
  19. /**
  20. * Functions for the replication GUI
  21. */
  22. class ReplicationGui
  23. {
  24. /** @var Replication */
  25. private $replication;
  26. /** @var Template */
  27. private $template;
  28. /**
  29. * @param Replication $replication Replication instance
  30. * @param Template $template Template instance
  31. */
  32. public function __construct(Replication $replication, Template $template)
  33. {
  34. $this->replication = $replication;
  35. $this->template = $template;
  36. }
  37. /**
  38. * returns HTML for error message
  39. *
  40. * @return string HTML code
  41. */
  42. public function getHtmlForErrorMessage(): string
  43. {
  44. $html = '';
  45. if (isset($_SESSION['replication']['sr_action_status'], $_SESSION['replication']['sr_action_info'])) {
  46. if ($_SESSION['replication']['sr_action_status'] === 'error') {
  47. $errorMessage = $_SESSION['replication']['sr_action_info'];
  48. $html .= Message::error($errorMessage)->getDisplay();
  49. $_SESSION['replication']['sr_action_status'] = 'unknown';
  50. } elseif ($_SESSION['replication']['sr_action_status'] === 'success') {
  51. $successMessage = $_SESSION['replication']['sr_action_info'];
  52. $html .= Message::success($successMessage)->getDisplay();
  53. $_SESSION['replication']['sr_action_status'] = 'unknown';
  54. }
  55. }
  56. return $html;
  57. }
  58. /**
  59. * returns HTML for primary replication
  60. *
  61. * @return string HTML code
  62. */
  63. public function getHtmlForPrimaryReplication(): string
  64. {
  65. global $dbi;
  66. if (! isset($_POST['repl_clear_scr'])) {
  67. $primaryStatusTable = $this->getHtmlForReplicationStatusTable('primary', true, false);
  68. if ($dbi->isMySql() && $dbi->getVersion() >= 80022) {
  69. $replicas = $dbi->fetchResult('SHOW REPLICAS', null, null);
  70. } elseif ($dbi->isMariaDB() && $dbi->getVersion() >= 100501) {
  71. $replicas = $dbi->fetchResult('SHOW REPLICA HOSTS', null, null);
  72. } else {
  73. $replicas = $dbi->fetchResult('SHOW SLAVE HOSTS', null, null);
  74. }
  75. $urlParams = $GLOBALS['urlParams'];
  76. $urlParams['primary_add_user'] = true;
  77. $urlParams['repl_clear_scr'] = true;
  78. }
  79. if (isset($_POST['primary_add_user'])) {
  80. $primaryAddReplicaUser = $this->getHtmlForReplicationPrimaryAddReplicaUser();
  81. }
  82. return $this->template->render('server/replication/primary_replication', [
  83. 'clear_screen' => isset($_POST['repl_clear_scr']),
  84. 'primary_status_table' => $primaryStatusTable ?? '',
  85. 'replicas' => $replicas ?? [],
  86. 'url_params' => $urlParams ?? [],
  87. 'primary_add_user' => isset($_POST['primary_add_user']),
  88. 'primary_add_replica_user' => $primaryAddReplicaUser ?? '',
  89. ]);
  90. }
  91. /**
  92. * returns HTML for primary replication configuration
  93. *
  94. * @return string HTML code
  95. */
  96. public function getHtmlForPrimaryConfiguration(): string
  97. {
  98. $databaseMultibox = $this->getHtmlForReplicationDbMultibox();
  99. return $this->template->render(
  100. 'server/replication/primary_configuration',
  101. ['database_multibox' => $databaseMultibox]
  102. );
  103. }
  104. /**
  105. * returns HTML for replica replication configuration
  106. *
  107. * @param bool $serverReplicaStatus Whether it is Primary or Replica
  108. * @param array $serverReplicaReplication Replica replication
  109. *
  110. * @return string HTML code
  111. */
  112. public function getHtmlForReplicaConfiguration(
  113. $serverReplicaStatus,
  114. array $serverReplicaReplication
  115. ): string {
  116. global $dbi;
  117. $serverReplicaMultiReplication = [];
  118. if ($dbi->isMariaDB() && $dbi->getVersion() >= 100501) {
  119. $serverReplicaMultiReplication = $dbi->fetchResult('SHOW ALL REPLICAS STATUS');
  120. } elseif ($dbi->isMariaDB()) {
  121. $serverReplicaMultiReplication = $dbi->fetchResult('SHOW ALL SLAVES STATUS');
  122. }
  123. $isReplicaIoRunning = false;
  124. $isReplicaSqlRunning = false;
  125. if ($serverReplicaStatus) {
  126. $urlParams = $GLOBALS['urlParams'];
  127. $urlParams['sr_take_action'] = true;
  128. $urlParams['sr_replica_server_control'] = true;
  129. $isReplicaIoRunning = isset($serverReplicaReplication[0]['Slave_IO_Running'])
  130. && $serverReplicaReplication[0]['Slave_IO_Running'] !== 'No'
  131. || isset($serverReplicaReplication[0]['Replica_IO_Running'])
  132. && $serverReplicaReplication[0]['Replica_SQL_Running'] !== 'No';
  133. $isReplicaSqlRunning = isset($serverReplicaReplication[0]['Slave_SQL_Running'])
  134. && $serverReplicaReplication[0]['Slave_SQL_Running'] !== 'No'
  135. || isset($serverReplicaReplication[0]['Replica_SQL_Running'])
  136. && $serverReplicaReplication[0]['Replica_SQL_Running'] !== 'No';
  137. if (! $isReplicaIoRunning) {
  138. $urlParams['sr_replica_action'] = 'start';
  139. } else {
  140. $urlParams['sr_replica_action'] = 'stop';
  141. }
  142. $urlParams['sr_replica_control_param'] = 'IO_THREAD';
  143. $replicaControlIoLink = Url::getCommon($urlParams, '', false);
  144. if (! $isReplicaSqlRunning) {
  145. $urlParams['sr_replica_action'] = 'start';
  146. } else {
  147. $urlParams['sr_replica_action'] = 'stop';
  148. }
  149. $urlParams['sr_replica_control_param'] = 'SQL_THREAD';
  150. $replicaControlSqlLink = Url::getCommon($urlParams, '', false);
  151. if (! $isReplicaIoRunning || ! $isReplicaSqlRunning) {
  152. $urlParams['sr_replica_action'] = 'start';
  153. } else {
  154. $urlParams['sr_replica_action'] = 'stop';
  155. }
  156. $urlParams['sr_replica_control_param'] = null;
  157. $replicaControlFullLink = Url::getCommon($urlParams, '', false);
  158. $urlParams['sr_replica_action'] = 'reset';
  159. $replicaControlResetLink = Url::getCommon($urlParams, '', false);
  160. $urlParams = $GLOBALS['urlParams'];
  161. $urlParams['sr_take_action'] = true;
  162. $urlParams['sr_replica_skip_error'] = true;
  163. $replicaSkipErrorLink = Url::getCommon($urlParams, '', false);
  164. $urlParams = $GLOBALS['urlParams'];
  165. $urlParams['replica_configure'] = true;
  166. $urlParams['repl_clear_scr'] = true;
  167. $reconfigurePrimaryLink = Url::getCommon($urlParams, '', false);
  168. $replicaStatusTable = $this->getHtmlForReplicationStatusTable('replica', true, false);
  169. }
  170. return $this->template->render('server/replication/replica_configuration', [
  171. 'server_replica_multi_replication' => $serverReplicaMultiReplication,
  172. 'url_params' => $GLOBALS['urlParams'],
  173. 'primary_connection' => $_POST['primary_connection'] ?? '',
  174. 'server_replica_status' => $serverReplicaStatus,
  175. 'replica_status_table' => $replicaStatusTable ?? '',
  176. 'replica_sql_running' => $isReplicaIoRunning,
  177. 'replica_io_running' => $isReplicaSqlRunning,
  178. 'replica_control_full_link' => $replicaControlFullLink ?? '',
  179. 'replica_control_reset_link' => $replicaControlResetLink ?? '',
  180. 'replica_control_sql_link' => $replicaControlSqlLink ?? '',
  181. 'replica_control_io_link' => $replicaControlIoLink ?? '',
  182. 'replica_skip_error_link' => $replicaSkipErrorLink ?? '',
  183. 'reconfigure_primary_link' => $reconfigurePrimaryLink ?? '',
  184. 'has_replica_configure' => isset($_POST['replica_configure']),
  185. ]);
  186. }
  187. /**
  188. * returns HTML code for selecting databases
  189. *
  190. * @return string HTML code
  191. */
  192. public function getHtmlForReplicationDbMultibox(): string
  193. {
  194. $databases = [];
  195. foreach ($GLOBALS['dblist']->databases as $database) {
  196. if (Utilities::isSystemSchema($database)) {
  197. continue;
  198. }
  199. $databases[] = $database;
  200. }
  201. return $this->template->render('server/replication/database_multibox', ['databases' => $databases]);
  202. }
  203. /**
  204. * returns HTML for changing primary
  205. *
  206. * @param string $submitName submit button name
  207. *
  208. * @return string HTML code
  209. */
  210. public function getHtmlForReplicationChangePrimary($submitName): string
  211. {
  212. [
  213. $usernameLength,
  214. $hostnameLength,
  215. ] = $this->getUsernameHostnameLength();
  216. return $this->template->render('server/replication/change_primary', [
  217. 'server_id' => time(),
  218. 'username_length' => $usernameLength,
  219. 'hostname_length' => $hostnameLength,
  220. 'submit_name' => $submitName,
  221. ]);
  222. }
  223. /**
  224. * This function returns html code for table with replication status.
  225. *
  226. * @param string $type either primary or replica
  227. * @param bool $isHidden if true, then default style is set to hidden, default value false
  228. * @param bool $hasTitle if true, then title is displayed, default true
  229. *
  230. * @return string HTML code
  231. */
  232. public function getHtmlForReplicationStatusTable(
  233. $type,
  234. $isHidden = false,
  235. $hasTitle = true
  236. ): string {
  237. global $dbi;
  238. $replicationInfo = new ReplicationInfo($dbi);
  239. $replicationInfo->load($_POST['primary_connection'] ?? null);
  240. $replicationVariables = $replicationInfo->primaryVariables;
  241. $variablesAlerts = [];
  242. $variablesOks = [];
  243. $serverReplication = $replicationInfo->getPrimaryStatus();
  244. if ($type === 'replica') {
  245. $replicationVariables = $replicationInfo->replicaVariables;
  246. $variablesAlerts = [
  247. 'Slave_IO_Running' => 'No',
  248. 'Slave_SQL_Running' => 'No',
  249. 'Replica_IO_Running' => 'No',
  250. 'Replica_SQL_Running' => 'No',
  251. ];
  252. $variablesOks = [
  253. 'Slave_IO_Running' => 'Yes',
  254. 'Slave_SQL_Running' => 'Yes',
  255. 'Replica_IO_Running' => 'Yes',
  256. 'Replica_SQL_Running' => 'Yes',
  257. ];
  258. $serverReplication = $replicationInfo->getReplicaStatus();
  259. }
  260. $variables = [];
  261. foreach ($replicationVariables as $variable) {
  262. if (! isset($serverReplication[0], $serverReplication[0][$variable])) {
  263. continue;
  264. }
  265. $serverReplicationVariable = $serverReplication[0][$variable];
  266. $variables[$variable] = [
  267. 'name' => $variable,
  268. 'status' => '',
  269. 'value' => $serverReplicationVariable,
  270. ];
  271. if (isset($variablesAlerts[$variable]) && $variablesAlerts[$variable] === $serverReplicationVariable) {
  272. $variables[$variable]['status'] = 'text-danger';
  273. } elseif (isset($variablesOks[$variable]) && $variablesOks[$variable] === $serverReplicationVariable) {
  274. $variables[$variable]['status'] = 'text-success';
  275. }
  276. $variablesWrap = [
  277. 'Replicate_Do_DB',
  278. 'Replicate_Ignore_DB',
  279. 'Replicate_Do_Table',
  280. 'Replicate_Ignore_Table',
  281. 'Replicate_Wild_Do_Table',
  282. 'Replicate_Wild_Ignore_Table',
  283. ];
  284. if (! in_array($variable, $variablesWrap)) {
  285. continue;
  286. }
  287. $variables[$variable]['value'] = str_replace(',', ', ', $serverReplicationVariable);
  288. }
  289. return $this->template->render('server/replication/status_table', [
  290. 'type' => $type,
  291. 'is_hidden' => $isHidden,
  292. 'has_title' => $hasTitle,
  293. 'variables' => $variables,
  294. ]);
  295. }
  296. /**
  297. * get the correct username and hostname lengths for this MySQL server
  298. *
  299. * @return array<int,int> username length, hostname length
  300. */
  301. public function getUsernameHostnameLength(): array
  302. {
  303. global $dbi;
  304. $fieldsInfo = $dbi->getColumns('mysql', 'user');
  305. $usernameLength = 16;
  306. $hostnameLength = 41;
  307. foreach ($fieldsInfo as $val) {
  308. if ($val['Field'] === 'User') {
  309. strtok($val['Type'], '()');
  310. $v = strtok('()');
  311. if (Util::isInteger($v)) {
  312. $usernameLength = (int) $v;
  313. }
  314. } elseif ($val['Field'] === 'Host') {
  315. strtok($val['Type'], '()');
  316. $v = strtok('()');
  317. if (Util::isInteger($v)) {
  318. $hostnameLength = (int) $v;
  319. }
  320. }
  321. }
  322. return [
  323. $usernameLength,
  324. $hostnameLength,
  325. ];
  326. }
  327. /**
  328. * returns html code to add a replication replica user to the primary
  329. *
  330. * @return string HTML code
  331. */
  332. public function getHtmlForReplicationPrimaryAddReplicaUser(): string
  333. {
  334. global $dbi;
  335. [
  336. $usernameLength,
  337. $hostnameLength,
  338. ] = $this->getUsernameHostnameLength();
  339. if (isset($_POST['username']) && strlen($_POST['username']) === 0) {
  340. $GLOBALS['pred_username'] = 'any';
  341. }
  342. $username = '';
  343. if (! empty($_POST['username'])) {
  344. $username = $GLOBALS['new_username'] ?? $_POST['username'];
  345. }
  346. $currentUser = $dbi->fetchValue('SELECT USER();');
  347. if (! empty($currentUser)) {
  348. $userHost = str_replace(
  349. "'",
  350. '',
  351. mb_substr(
  352. $currentUser,
  353. mb_strrpos($currentUser, '@') + 1
  354. )
  355. );
  356. if ($userHost !== 'localhost' && $userHost !== '127.0.0.1') {
  357. $thisHost = $userHost;
  358. }
  359. }
  360. // when we start editing a user, $GLOBALS['pred_hostname'] is not defined
  361. if (! isset($GLOBALS['pred_hostname']) && isset($_POST['hostname'])) {
  362. switch (mb_strtolower($_POST['hostname'])) {
  363. case 'localhost':
  364. case '127.0.0.1':
  365. $GLOBALS['pred_hostname'] = 'localhost';
  366. break;
  367. case '%':
  368. $GLOBALS['pred_hostname'] = 'any';
  369. break;
  370. default:
  371. $GLOBALS['pred_hostname'] = 'userdefined';
  372. break;
  373. }
  374. }
  375. return $this->template->render('server/replication/primary_add_replica_user', [
  376. 'username_length' => $usernameLength,
  377. 'hostname_length' => $hostnameLength,
  378. 'has_username' => isset($_POST['username']),
  379. 'username' => $username,
  380. 'hostname' => $_POST['hostname'] ?? '',
  381. 'predefined_username' => $GLOBALS['pred_username'] ?? '',
  382. 'predefined_hostname' => $GLOBALS['pred_hostname'] ?? '',
  383. 'this_host' => $thisHost ?? null,
  384. ]);
  385. }
  386. /**
  387. * handle control requests
  388. */
  389. public function handleControlRequest(): void
  390. {
  391. if (! isset($_POST['sr_take_action'])) {
  392. return;
  393. }
  394. $refresh = false;
  395. $result = false;
  396. $messageSuccess = '';
  397. $messageError = '';
  398. if (isset($_POST['replica_changeprimary']) && ! $GLOBALS['cfg']['AllowArbitraryServer']) {
  399. $_SESSION['replication']['sr_action_status'] = 'error';
  400. $_SESSION['replication']['sr_action_info'] = __(
  401. 'Connection to server is disabled, please enable'
  402. . ' $cfg[\'AllowArbitraryServer\'] in phpMyAdmin configuration.'
  403. );
  404. } elseif (isset($_POST['replica_changeprimary'])) {
  405. $result = $this->handleRequestForReplicaChangePrimary();
  406. } elseif (isset($_POST['sr_replica_server_control'])) {
  407. $result = $this->handleRequestForReplicaServerControl();
  408. $refresh = true;
  409. switch ($_POST['sr_replica_action']) {
  410. case 'start':
  411. $messageSuccess = __('Replication started successfully.');
  412. $messageError = __('Error starting replication.');
  413. break;
  414. case 'stop':
  415. $messageSuccess = __('Replication stopped successfully.');
  416. $messageError = __('Error stopping replication.');
  417. break;
  418. case 'reset':
  419. $messageSuccess = __('Replication resetting successfully.');
  420. $messageError = __('Error resetting replication.');
  421. break;
  422. default:
  423. $messageSuccess = __('Success.');
  424. $messageError = __('Error.');
  425. break;
  426. }
  427. } elseif (isset($_POST['sr_replica_skip_error'])) {
  428. $result = $this->handleRequestForReplicaSkipError();
  429. }
  430. if ($refresh) {
  431. $response = ResponseRenderer::getInstance();
  432. if ($response->isAjax()) {
  433. $response->setRequestStatus($result);
  434. $response->addJSON(
  435. 'message',
  436. $result
  437. ? Message::success($messageSuccess)
  438. : Message::error($messageError)
  439. );
  440. } else {
  441. Core::sendHeaderLocation(
  442. './index.php?route=/server/replication'
  443. . Url::getCommonRaw($GLOBALS['urlParams'], '&')
  444. );
  445. }
  446. }
  447. unset($refresh);
  448. }
  449. public function handleRequestForReplicaChangePrimary(): bool
  450. {
  451. global $dbi;
  452. $sr = [
  453. 'username' => $dbi->escapeString($_POST['username']),
  454. 'pma_pw' => $dbi->escapeString($_POST['pma_pw']),
  455. 'hostname' => $dbi->escapeString($_POST['hostname']),
  456. 'port' => (int) $dbi->escapeString($_POST['text_port']),
  457. ];
  458. $_SESSION['replication']['m_username'] = $sr['username'];
  459. $_SESSION['replication']['m_password'] = $sr['pma_pw'];
  460. $_SESSION['replication']['m_hostname'] = $sr['hostname'];
  461. $_SESSION['replication']['m_port'] = $sr['port'];
  462. $_SESSION['replication']['m_correct'] = '';
  463. $_SESSION['replication']['sr_action_status'] = 'error';
  464. $_SESSION['replication']['sr_action_info'] = __('Unknown error');
  465. // Attempt to connect to the new primary server
  466. $linkToPrimary = $this->replication->connectToPrimary(
  467. $sr['username'],
  468. $sr['pma_pw'],
  469. $sr['hostname'],
  470. $sr['port']
  471. );
  472. if (! $linkToPrimary) {
  473. $_SESSION['replication']['sr_action_status'] = 'error';
  474. $_SESSION['replication']['sr_action_info'] = sprintf(
  475. __('Unable to connect to primary %s.'),
  476. htmlspecialchars($sr['hostname'])
  477. );
  478. } else {
  479. // Read the current primary position
  480. $position = $this->replication->replicaBinLogPrimary(DatabaseInterface::CONNECT_AUXILIARY);
  481. if (empty($position)) {
  482. $_SESSION['replication']['sr_action_status'] = 'error';
  483. $_SESSION['replication']['sr_action_info'] = __(
  484. 'Unable to read primary log position. Possible privilege problem on primary.'
  485. );
  486. } else {
  487. $_SESSION['replication']['m_correct'] = true;
  488. if (
  489. ! $this->replication->replicaChangePrimary(
  490. $sr['username'],
  491. $sr['pma_pw'],
  492. $sr['hostname'],
  493. $sr['port'],
  494. $position,
  495. true,
  496. false,
  497. DatabaseInterface::CONNECT_USER
  498. )
  499. ) {
  500. $_SESSION['replication']['sr_action_status'] = 'error';
  501. $_SESSION['replication']['sr_action_info'] = __('Unable to change primary!');
  502. } else {
  503. $_SESSION['replication']['sr_action_status'] = 'success';
  504. $_SESSION['replication']['sr_action_info'] = sprintf(
  505. __('Primary server changed successfully to %s.'),
  506. htmlspecialchars($sr['hostname'])
  507. );
  508. }
  509. }
  510. }
  511. return $_SESSION['replication']['sr_action_status'] === 'success';
  512. }
  513. public function handleRequestForReplicaServerControl(): bool
  514. {
  515. global $dbi;
  516. /** @var string|null $control */
  517. $control = $_POST['sr_replica_control_param'] ?? null;
  518. if ($_POST['sr_replica_action'] === 'reset') {
  519. $qStop = $this->replication->replicaControl('STOP', null, DatabaseInterface::CONNECT_USER);
  520. if ($dbi->isMySql() && $dbi->getVersion() >= 80022 || $dbi->isMariaDB() && $dbi->getVersion() >= 100501) {
  521. $qReset = $dbi->tryQuery('RESET REPLICA;');
  522. } else {
  523. $qReset = $dbi->tryQuery('RESET SLAVE;');
  524. }
  525. $qStart = $this->replication->replicaControl('START', null, DatabaseInterface::CONNECT_USER);
  526. $result = $qStop !== false && $qStop !== -1 &&
  527. $qReset !== false &&
  528. $qStart !== false && $qStart !== -1;
  529. } else {
  530. $qControl = $this->replication->replicaControl(
  531. $_POST['sr_replica_action'],
  532. $control,
  533. DatabaseInterface::CONNECT_USER
  534. );
  535. $result = $qControl !== false && $qControl !== -1;
  536. }
  537. return $result;
  538. }
  539. public function handleRequestForReplicaSkipError(): bool
  540. {
  541. global $dbi;
  542. $count = 1;
  543. if (isset($_POST['sr_skip_errors_count'])) {
  544. $count = $_POST['sr_skip_errors_count'] * 1;
  545. }
  546. $qStop = $this->replication->replicaControl('STOP', null, DatabaseInterface::CONNECT_USER);
  547. if ($dbi->isMySql() && $dbi->getVersion() >= 80400) {
  548. $qSkip = $dbi->tryQuery('SET GLOBAL SQL_REPLICA_SKIP_COUNTER = ' . $count . ';');
  549. } else {
  550. $qSkip = $dbi->tryQuery('SET GLOBAL SQL_SLAVE_SKIP_COUNTER = ' . $count . ';');
  551. }
  552. $qStart = $this->replication->replicaControl('START', null, DatabaseInterface::CONNECT_USER);
  553. return $qStop !== false && $qStop !== -1 &&
  554. $qSkip !== false &&
  555. $qStart !== false && $qStart !== -1;
  556. }
  557. }