Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15354945
D16386.id39410.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D16386.id39410.diff
View Options
diff --git a/src/infrastructure/storage/lisk/PhabricatorLiskDAO.php b/src/infrastructure/storage/lisk/PhabricatorLiskDAO.php
--- a/src/infrastructure/storage/lisk/PhabricatorLiskDAO.php
+++ b/src/infrastructure/storage/lisk/PhabricatorLiskDAO.php
@@ -122,15 +122,16 @@
}
$replica = PhabricatorDatabaseRef::getReplicaDatabaseRef();
- if (!$replica) {
- throw new Exception(
- pht('No valid databases are configured!'));
+ if ($replica) {
+ $connection = $replica->newApplicationConnection($database);
+ $connection->setReadOnly(true);
+ if ($replica->isReachable($connection)) {
+ return $connection;
+ }
}
- $connection = $replica->newApplicationConnection($database);
- $connection->setReadOnly(true);
- if ($replica->isReachable($connection)) {
- return $connection;
+ if (!$master && !$replica) {
+ $this->raiseUnconfigured($database);
}
$this->raiseUnreachable($database);
@@ -153,10 +154,18 @@
$database));
}
+ private function raiseUnconfigured($database) {
+ throw new Exception(
+ pht(
+ 'Unable to establish a connection to any database host '.
+ '(while trying "%s"). No masters or replicas are configured.',
+ $database));
+ }
+
private function raiseUnreachable($database) {
throw new PhabricatorClusterStrandedException(
pht(
- 'Unable to establish a connection to ANY database host '.
+ 'Unable to establish a connection to any database host '.
'(while trying "%s"). All masters and replicas are completely '.
'unreachable.',
$database));
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 12, 5:41 AM (2 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7224194
Default Alt Text
D16386.id39410.diff (1 KB)
Attached To
Mode
D16386: Fix misleading error message when only cluster database masters are configured
Attached
Detach File
Event Timeline
Log In to Comment