Page MenuHomePhabricator

[toolsdb] pt-heartbeat service should automatically follow the primary
Open, MediumPublic

Description

ATM the hiera key profile::wmcs::services::toolsdb::primary_server must be changed manually as per procedure to promote a replica to primary. Since we switch the DNS name tools.db.svc.wikimedia.cloud anyways as part of the procedure, the hiera key above can be replaced by checking DNS.

A solution outline looks like this (untested)

$service_record = "tools.db.svc.wikimedia.cloud"
$is_active_host = (ipresolve($service_record, 4) == $facts['networking']['ip']) or (ipresolve($service_record, 6) == $facts['networking']['ip6'])

Then $is_active_host can be used to set units as present or absent (or the service as running/stopped)

Incident metadata:

Event Timeline

fnegri renamed this task from Make toolsdb pt-heartbeat service automatically follow the primary to [toolsdb] pt-heartbeat service should automatically follow the primary.Nov 12 2025, 11:52 AM
fnegri triaged this task as Medium priority.
fnegri subscribed.