Skip to main content

Perform Aiven for PostgreSQL® switchback to the primary region Limited availability

Shift your workloads back to the primary region, where your service was hosted originally before switching over to the recovery region.

Prerequisites

Switch back

Run avn service update to promote the primary service back to active:

avn service update PRIMARY_SERVICE_NAME \
--disaster-recovery-role active

Replace PRIMARY_SERVICE_NAME with the name of the primary service, for example, pg-demo.

Verify the switchback by checking both services:

  • Primary service status:

    avn service get PRIMARY_SERVICE_NAME \
    --json | jq '{state: .state, disaster_recovery_role: .disaster_recovery_role}'

    Expect the following output:

    {
    "state": "RUNNING",
    "disaster_recovery_role": "active"
    }
  • Recovery service status:

    avn service get RECOVERY_SERVICE_NAME \
    --json | jq '{state: .state, disaster_recovery_role: .disaster_recovery_role}'

    Expect the following output:

    {
    "state": "RUNNING",
    "disaster_recovery_role": "passive"
    }

After the switchback completes, your primary service is Active, and the recovery service is Passive, which means the primary service is in control over your workloads.

Related pages