DatabaseConsistencyService
class DatabaseConsistencyService (View source)
Methods
No description
Check if all zones have an owner
Check if all slave zones have master IP addresses
Check if all records belong to existing zones
Check for duplicate SOA records
Check for zones without SOA records
Run all consistency checks.
Find zones rows whose domain_id never received the zone's canonical id.
Point a stranded zones row's domain_id at its own id.
Repair every zone returned by checkZonesHaveCanonicalIds().
Fix zone without owner by assigning the current user as owner
Assign the current user as owner to every zone returned by checkZonesHaveOwners().
Delete a slave zone
Delete an orphaned record
Fix duplicate SOA records by keeping only the first one
Create a default SOA record for a zone
Details
__construct(PDO $db, ConfigurationManager $config, DnsBackendProvider|null $backendProvider = null)
No description
array
checkZonesHaveOwners(array|null $apiZones = null)
Check if all zones have an owner
array
checkSlaveZonesHaveMasters(array|null $apiZones = null)
Check if all slave zones have master IP addresses
array
checkRecordsBelongToZones()
Check if all records belong to existing zones
array
checkDuplicateSOARecords(array|null $apiZones = null)
Check for duplicate SOA records
array
checkZonesWithoutSOA(array|null $apiZones = null)
Check for zones without SOA records
array|null
runAllChecks()
Run all consistency checks.
In API mode the zone list is fetched once and reused across every check, so a single transient failure can't make one check pass while another fails. Returns null when that fetch reveals an API outage, letting the caller surface one clear error instead of empty "all clear" results.
array
checkZonesHaveCanonicalIds()
Find zones rows whose domain_id never received the zone's canonical id.
createZone() writes the row and backfills domain_id; interrupted between the two it used to leave the row unresolvable, and nothing else repairs it.
bool
fixZoneCanonicalId(int $zoneId)
Point a stranded zones row's domain_id at its own id.
$zoneId is the row's primary key, not a canonical id, because the row has none yet.
array
fixAllZonesWithCanonicalIdIssue()
Repair every zone returned by checkZonesHaveCanonicalIds().
bool
fixZoneWithoutOwner(int $zoneId, int $currentUserId)
Fix zone without owner by assigning the current user as owner
array
fixAllZonesWithoutOwner(int $currentUserId)
Assign the current user as owner to every zone returned by checkZonesHaveOwners().
bool
deleteSlaveZone(int $zoneId)
Delete a slave zone
bool
deleteOrphanedRecord(int $recordId)
Delete an orphaned record
bool
fixDuplicateSOA(int $zoneId)
Fix duplicate SOA records by keeping only the first one
bool
createDefaultSOA(int $zoneId)
Create a default SOA record for a zone