From be6a3542a92e5976af411f6271035cafec0a4de4 Mon Sep 17 00:00:00 2001 From: Minsoo Choo Date: Fri, 13 Jun 2025 16:27:04 +0300 Subject: [PATCH] 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 --- .../config/check/PhabricatorDatabaseSetupCheck.php | 2 +- src/docs/user/cluster/cluster_databases.diviner | 2 +- src/docs/user/installation_guide.diviner | 2 +- src/infrastructure/cluster/PhabricatorDatabaseRef.php | 6 +++--- .../connection/mysql/AphrontBaseMySQLDatabaseConnection.php | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/applications/config/check/PhabricatorDatabaseSetupCheck.php b/src/applications/config/check/PhabricatorDatabaseSetupCheck.php index 99815d85e6..a89d3972e2 100644 --- a/src/applications/config/check/PhabricatorDatabaseSetupCheck.php +++ b/src/applications/config/check/PhabricatorDatabaseSetupCheck.php @@ -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. diff --git a/src/docs/user/cluster/cluster_databases.diviner b/src/docs/user/cluster/cluster_databases.diviner index c13cc2eba4..51d8c642e3 100644 --- a/src/docs/user/cluster/cluster_databases.diviner +++ b/src/docs/user/cluster/cluster_databases.diviner @@ -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 diff --git a/src/docs/user/installation_guide.diviner b/src/docs/user/installation_guide.diviner index fd0f929f15..db9fcd9fd7 100644 --- a/src/docs/user/installation_guide.diviner +++ b/src/docs/user/installation_guide.diviner @@ -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. diff --git a/src/infrastructure/cluster/PhabricatorDatabaseRef.php b/src/infrastructure/cluster/PhabricatorDatabaseRef.php index ce3711b543..590b194328 100644 --- a/src/infrastructure/cluster/PhabricatorDatabaseRef.php +++ b/src/infrastructure/cluster/PhabricatorDatabaseRef.php @@ -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); } diff --git a/src/infrastructure/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php b/src/infrastructure/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php index 6ff9b3ba90..6aa4dbc780 100644 --- a/src/infrastructure/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php +++ b/src/infrastructure/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php @@ -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.