Replace SLAVE with REPLICA

Summary:
Since MySQL 8.0, the term slave was replaced with replica due to terminology.
This patch elevates the minimum MySQL version to 8.0.

Test Plan: Test the latest (9.3 for now) and LTS versions (8.0 and 8.4).

Reviewers: O1 Blessed Committers, avivey, mainframe98

Reviewed By: O1 Blessed Committers, avivey, mainframe98

Subscribers: aklapper, mainframe98, avivey, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16107

Differential Revision: https://we.phorge.it/D26081
This commit is contained in:
Minsoo Choo 2025-06-13 16:27:04 +03:00 committed by Aviv Eyal
parent 6bcc10fbf1
commit be6a3542a9
5 changed files with 7 additions and 7 deletions

View file

@ -173,7 +173,7 @@ final class PhabricatorDatabaseSetupCheck extends PhabricatorSetupCheck {
}
// NOTE: It's possible that replication is broken but we have not been
// granted permission to "SHOW SLAVE STATUS" so we can't figure it out.
// granted permission to "SHOW REPLICA STATUS" so we can't figure it out.
// We allow this kind of configuration and survive these checks, trusting
// that operations knows what they're doing. This issue is shown on the
// "Database Servers" console.

View file

@ -143,7 +143,7 @@ should //not// be replicating from another database.
To report this status, the user Phorge is connecting as must have the
`REPLICATION CLIENT` privilege (or the `SUPER` privilege) so it can run the
`SHOW SLAVE STATUS` command. The `REPLICATION CLIENT` privilege only enables
`SHOW REPLICA STATUS` command. The `REPLICATION CLIENT` privilege only enables
the user to run diagnostic commands so it should be reasonable to grant it in
most cases, but it is not required. If you choose not to grant it, this page
can not show any useful diagnostic information about replication status but

View file

@ -77,7 +77,7 @@ Beyond an operating system, you will need **a webserver**.
You will also need:
- **MySQL**: You need MySQL. We strongly recommend MySQL 5.5 or newer.
- **MySQL**: You need MySQL. The required version is MySQL 8.0 or newer.
You will need a server with multiple databases.
- **PHP**: You need a PHP engine:
- PHP 7 - 7.2.25 or newer.

View file

@ -346,13 +346,13 @@ final class PhabricatorDatabaseRef
$t_start = microtime(true);
$replica_status = false;
try {
$replica_status = queryfx_one($conn, 'SHOW SLAVE STATUS');
$replica_status = queryfx_one($conn, 'SHOW REPLICA STATUS');
$ref->setConnectionStatus(self::STATUS_OKAY);
} catch (AphrontAccessDeniedQueryException $ex) {
$ref->setConnectionStatus(self::STATUS_REPLICATION_CLIENT);
$ref->setConnectionMessage(
pht(
'No permission to run "SHOW SLAVE STATUS". Grant this user '.
'No permission to run "SHOW REPLICA STATUS". Grant this user '.
'"REPLICATION CLIENT" permission to allow this server to '.
'monitor replica health.'));
} catch (AphrontInvalidCredentialsQueryException $ex) {
@ -386,7 +386,7 @@ final class PhabricatorDatabaseRef
$ref->setReplicaMessage(
pht(
'This host has a "replica" role, but is not replicating data '.
'from a master (no output from "SHOW SLAVE STATUS").'));
'from a master (no output from "SHOW REPLICA STATUS").'));
} else {
$ref->setReplicaStatus(self::REPLICATION_OKAY);
}

View file

@ -347,7 +347,7 @@ abstract class AphrontBaseMySQLDatabaseConnection
case 1044: // Access denied to database
case 1142: // Access denied to table
case 1143: // Access denied to column
case 1227: // Access denied (e.g., no SUPER for SHOW SLAVE STATUS).
case 1227: // Access denied (e.g., no SUPER for SHOW REPLICA STATUS).
// See T13622. Try to help users figure out that this is a GRANT
// problem.