User azuresu cannot set transaction read-write mode during recovery on azure_maintenance database on replica server

Vinicius Barbosa 40 Reputation points
2026-06-29T16:26:53.63+00:00

While I was checking my PostgreSQL Flexible Server replica Logs, I noticed there are multiple occurrences of an error on the same hour and on every hour of existence of the replica server. As far as I'm aware there is no impact on the server functionality, but it is weird that this error is being thrown since forever.
I'd like to understand a few things:

  • Why the replica is having these errors?
  • Are they expected to occur because it is a read replica after all?
  • Is this a scheduled interaction between user azuresu and the azure_maintenance database that is not taking in consideration that this is a read replica?
  • Is the azure_maintenance from the primary also being replicated to the replica server?

I've extracted this sample from my replica's server logs. I'm assuming they come from the same interaction with the azure_maintenance database because of the UTC-6a426c4f.2a18c4 value on them.

2026-06-29 13:00:00 UTC-6a426c4f.2a18c4-LOG:  [Microsoft Entra] aad_tenant_id is NULL","LOCPATH": "/usr/lib/locale-2.35
2026-06-29 13:00:00 UTC-6a426c4f.2a18c4-LOG:  connection authenticated: identity="CN=azuresu.e28824159476.database.azure.com" method=cert (/datadrive/pg/data/pg_hba.conf:19)","LOCPATH": "/usr/lib/locale-2.35
2026-06-29 13:00:00 UTC-6a426c4f.2a18c4-LOG:  connection authorized: user=azuresu database=azure_maintenance SSL enabled (protocol=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384, bits=256)","LOCPATH": "/usr/lib/locale-2.35
2026-06-29 13:00:00 UTC-6a426c4f.2a18c4-ERROR:  cannot set transaction read-write mode during recovery","statement": "set transaction read write","LOCPATH": "/usr/lib/locale-2.35
2026-06-29 13:00:07 UTC-6a426c4f.2a18c4-ERROR:  cannot set transaction read-write mode during recovery","statement": "set transaction read write","LOCPATH": "/usr/lib/locale-2.35
2026-06-29 13:00:15 UTC-6a426c4f.2a18c4-ERROR:  cannot set transaction read-write mode during recovery","statement": "set transaction read write","LOCPATH": "/usr/lib/locale-2.35
2026-06-29 13:00:20 UTC-6a426c4f.2a18c4-LOG:  disconnection: session time: 0:00:20.194 user=azuresu database=azure_maintenance host=169.254.128.1 port=42504","LOCPATH": "/usr/lib/locale-2.35

Azure Database for PostgreSQL

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.