Hi Anil Kumar,
Your PostgreSQL Flexible Server entering "recovery mode" with read-only databases is a standard indicator of an ongoing high availability (HA) failover process, especially since it's configured with Zone-Redundant HA the standby replica is promoting to primary after detecting a primary issue.
Stop/restarts won't help as they extend the transition; monitor for auto-completion instead.
Check Current Status
- In Azure Portal, go to Overview status should shift from "Recovery" to "Available" (typically 5-15 mins).
- Under High availability blade, note Primary/Standby roles (they swap post-failover).
- Resource Health (Support + troubleshooting) shows HA events like "Unplanned Failover".
Resolve if Stuck
Connect read-only and run: SELECT pg_is_in_recovery(); (returns true during recovery).
- Trigger Planned failover from HA blade for quick resolution (~60s downtime).
- Rule out storage full: Compute + storage >95% triggers read-only.
Monitor & Prevent
Set alerts on Monitoring > Alerts for Resource Health/HA metrics (e.g., is_read_only). Connection via FQDN remains valid no changes needed.
Share a screenshot of Resource Health/HA blade or server name for more targeted help. This resolves 99% of cases without data loss.
References: