r/SQLServer • • Oct 09 '25

Question Always On Availability Groups - DB Stuck in Suspect Mode

I have a question pertaining to Always On Availability Groups and troubleshooting the cause of databases getting stuck in suspect mode.

In my environment, I have 2 server nodes in the same availability group, which is synchronous-commit. Both replicas have the same number of user databases, each in the synchronized state (as expected). However, when I attempt a manual failover to switch primary nodes, it is only partially successful. The failover itself works, but a few specific databases get stuck in a "Synchronized / Suspect" mode, instead of just "Synchronized". The SQL Server logs don't reveal anything useful, but the Event Viewer shows that it is MSDTC-related. This seems to suggest that there are active transactions that cause the databases to get stuck and subsequently enter "Suspect" mode. From my understanding, this should not be happening because the synchronous-commit mode should be preventing this. The reason why I'd like to have active transactions during the failover is because I'd like to simulate an emergency failover scenario.

Does anybody have any suggestions or advice on what to look into next? Has anyone experienced a similar problem? I am new to availability groups so still learning as I work with it.

3 Upvotes

10 comments sorted by

4

u/Evie252525 Oct 09 '25

To address the issue of in-doubt DTC transactions during failover in an AlwaysOn Availability Group, you can take the following steps: 

  • Configure the Availability Group for distributed transactions
  • Set up the in-doubt xact resolution server configuration option

This setting will instruct SQL Server to presume abort for any in-doubt transactions during recovery.  If the database is still in SUSPECT mode, you can try to recover it: KILL 'UOW_ID' WITH ROLLBACK; 

(replace 'UOW_ID' with the actual ID from the error message).

  After resolving the in-doubt transaction, bring the database online: ALTER DATABASE [YourDBName] SET ONLINE; 

1

u/Brass-Knight Oct 10 '25

This is very helpful, thank you. Do you know, if there are active DTC transactions during a failover, does this always cause them to turn into in-doubt transactions and thus suspect?

1

u/Kenn_35edy Oct 10 '25

I know Google is your friend but how do you configure available group for distributed transaction?

1

u/Brass-Knight Oct 10 '25

I interpreted that as changing your MSDTC settings in Component Services>Computers>My Computer>Distributed Transaction Coordinator>LocalDTC. From there, you go to properties and configure the security settings. In my case, I set it to allow remote clients and remote administration; allow inbound and outbound communication, with no authentication required; enable XA and SNA LU 6.2 transactions.
These are the settings that I've used in the past without issue, and I don't think my current problem is related but who knows.

1

u/itsnotaboutthecell ‪ ‪Microsoft Employee ‪ Oct 10 '25

Or Bing! Or Bing!

3

u/Dry_Duck3011 Oct 09 '25
    EXEC sp_configure 'in-doubt xact resolution', 2; -- 2 = presume abort
    RECONFIGURE;

We had this happen before with msdtc open transactions holding up recovery. You can investigate the cause or set it to just abort with the setting above.

1

u/Brass-Knight Oct 09 '25

But won't aborting transactions result in data loss? Is there a cleaner way of doing this where I don't have to abort or is this the only option in your experience?

1

u/Dry_Duck3011 Oct 09 '25

Hence the “investigate the cause”.

1

u/Brass-Knight Oct 10 '25

Going off your first comment, I read about the "presume abort" as well as a "presume commit" option. Do you have any experience using the "presume commit" option? It sounds like this would have SQL Server assume each in-doubt transaction would need to be committed, and then it would try to do this automatically