An Azure managed PostgreSQL database service for app development and deployment.
Azure Database for PostgreSQL: Issue with Deletion Due to Active Replicas — Metadata Stale or Stuck Role?
Problem description
I am attempting to delete an Azure Database for PostgreSQL flexible server (Citus) in West Europe, but the delete operation fails because the server reports that there are 2 active replicas, even though I believe the replica has already been removed. The error indicates that the server has active replicas, which prevents deletion.
Environment
Azure Database for PostgreSQL flexible server (Citus), PostgreSQL version 17, in West Europe, with a 2-node cluster and a geo-replica in Sweden Central.
What I've already tried
I created a geo-replica, performed switchovers, and then attempted to delete the source cluster via Azure CLI. The delete failed due to active replicas. I also checked the server state, which reports 'Ready' and 'Primary', but the delete still fails. I reviewed the replica list using Azure CLI and REST API, which returned an empty list, suggesting no visible replicas. I also checked the server's current state, which shows 'Ready' and 'Primary', but the service reports 2 active replicas, indicating potential stale metadata or stuck role states.
Current status
I am seeking guidance on how to resolve the discrepancy between the server's reported active replicas and the absence of visible replicas, to successfully delete the server. Specifically, I want to understand how to clear any stale geo-replication metadata or resolve potential stuck roles that prevent deletion.