1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-20 19:51:08 +01:00
phorge-phorge/src/infrastructure/cluster
epriestley d0013d0898 Distinguish between unreachable cluster database hosts and missing MySQL databases
Summary:
Fixes T11577. When we connect to a host and try to select a database which does not exist, we currently treat it as though the host wasn't reachable.

This isn't correct, and prevents storage from being initialized while already in cluster mode, since the "config" database won't exist yet the first time we connect.

Instead, distinguish between `AphrontSchemaQueryException` (thrown on connection if the requested database is not present) and other errors.

Test Plan:
  - Put Phabricator into cluster database mode (`cluster.databases = ...`).
  - Swapped `storage.default-namespace` to force initialization of a new install.
  - Ran `bin/storage upgrade`.
    - Before patch: Immediate fatal about unreachablility.
    - After patch: Database initialized.
  - Also ran initialization steps in tranditional single-host mode (`cluster.databases` empty, `mysql.host` configured).

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11577

Differential Revision: https://secure.phabricator.com/D16489
2016-09-02 08:23:21 -07:00
..
PhabricatorClusterDatabasesConfigOptionType.php Lay cluster.databases configuration groundwork for database clustering 2016-04-09 13:41:16 -07:00
PhabricatorClusterException.php When no master database is configured, automatically degrade to read-only mode 2016-04-10 12:19:55 -07:00
PhabricatorClusterExceptionHandler.php Automatically degrade to read-only mode when unable to connect to the master 2016-04-10 12:20:13 -07:00
PhabricatorClusterImpossibleWriteException.php Automatically degrade to read-only mode when unable to connect to the master 2016-04-10 12:20:13 -07:00
PhabricatorClusterImproperWriteException.php When no master database is configured, automatically degrade to read-only mode 2016-04-10 12:19:55 -07:00
PhabricatorClusterStrandedException.php Automatically degrade to read-only mode when unable to connect to the master 2016-04-10 12:20:13 -07:00
PhabricatorDatabaseHealthRecord.php Never sever non-cluster database; write more read-only documentation 2016-04-11 08:44:11 -07:00
PhabricatorDatabaseRef.php Distinguish between unreachable cluster database hosts and missing MySQL databases 2016-09-02 08:23:21 -07:00