phacility/phabricator · critical · Exception
Multiple masters (databases "%s" and "%s") specify that they
Error message
Multiple masters (databases "%s" and "%s") specify that they are the partition for application "%s". Each application may be allocated to only one partition.
What it means
Each application database may be allocated to exactly one partition in a multi-master cluster. The parser tracks applications in $partition_map and throws when a second master's 'partition' list names an application that another master already owns.
Source
Thrown at src/infrastructure/cluster/PhabricatorDatabaseRefParser.php:115
}
$application_map = array();
foreach ($partition as $application) {
if ($application === 'default') {
if ($default_ref) {
throw new Exception(
pht(
'Multiple masters (databases "%s" and "%s") specify that '.
'they are the "default" partition. Only one master may be '.
'the default.',
$ref->getRefKey(),
$default_ref->getRefKey()));
} else {
$default_ref = $ref;
$ref->setIsDefaultPartition(true);
}
} else if (isset($partition_map[$application])) {
throw new Exception(
pht(
'Multiple masters (databases "%s" and "%s") specify that '.
'they are the partition for application "%s". Each '.
'application may be allocated to only one partition.',
$partition_map[$application]->getRefKey(),
$ref->getRefKey(),
$application));
} else {
// TODO: We should check that the application is valid, to
// prevent typos in application names. However, we do not
// currently have an efficient way to enumerate all of the valid
// application database names.
$partition_map[$application] = $ref;
$application_map[$application] = $application;
}
}
View on GitHub (pinned to 5720a38cfe)
Solutions
- Assign each application name to exactly one master's 'partition' list and delete duplicates.
- If you wanted replication rather than partitioning, keep one master and configure the second host as a replica ('master' => false).
- Re-check that every application still lands somewhere (or on 'default') after the edit.
Example fix
// before ["partition" => ["maniphest", "differential"]] // db1 ["partition" => ["differential"]] // db2 // after ["partition" => ["maniphest"]] // db1 ["partition" => ["differential"]] // db2
Defensive patterns
Strategy: validation
Validate before calling
// Each application may appear in only one partition list
$seen = array();
foreach ($cluster_database_config as $server) {
foreach (idx($server, 'partition', array()) as $application) {
if ($application === 'default') { continue; }
if (isset($seen[$application])) {
// reject: application allocated to two masters
}
$seen[$application] = true;
}
} Prevention
- Keep partition allocation in one authoritative table (master -> app list) and generate config from it.
- After splitting applications, grep all masters' partition lists for the moved names.
- Use a replica (not a second master) when the goal is redundancy, not partitioning.
When it happens
Trigger: Two cluster.databases masters both include the same application name (e.g. 'maniphest') in their 'partition' arrays.
Common situations: Overlapping partition lists after splitting by team; a renamed copy of a master block that still carries the old application list; intending a master/replica setup but configuring two masters with identical partitions instead.
Related errors
- This server is configured with multiple master databases, bu
- Multiple masters (databases "%s" and "%s") specify that they
- Multiple configured databases have the same internal key, "%
- Database "%s" is configured as a replica, but specifies a "p
- Database "%s" is configured as a replica, but does not speci
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/e4847583f40e370e.
Report an issue: GitHub.