denisenkom / pytds

Python DBAPI driver for MSSQL using pure Python TDS (Tabular Data Stream) protocol implementation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Consider message_id 976 when connecting to a secondary node in always on

vcenturionmerkle opened this issue · comments

Although AlwaysOn Availability Groups is NOT supported, I believe we should add the message_id 976 ("The target database, '%.*ls', is participating in an availability group and is currently not accessible for queries. Either data movement is suspended or the availability replica is not enabled for read access. To allow read-only access to this and other databases in the availability group, enable read access to one or more secondary availability replicas in the group. For more information, see the ALTER AVAILABILITY GROUP statement in SQL Server Books Online.") so when this occurs the retry policy is not triggered as it makes no sense to do it.

Currently we had to disable retries using 'disable_connect_retry' when creating a connection but we are not sure if this could be somehow risky.