FIX: "Remote hardening failure" exception cannot be caught and a potential data loss when you use SQL Server 2014

Symptoms

Assume that you enable AlwaysOn Availability Groups in an instance of Microsoft SQL Server 2014. You perform an availability group failover while the primary replica has active transactions. Then, you receive the following 3303 warning message:
Remote harden of transaction '%.*ls' (ID 0x%016I64x %ls) started at %S_DATE in database '%ls' at LSN %S_LSN failed.
In this situation, the following data drivers or providers cannot catch the "remote hardening failure" exception:
  • Microsoft JDBC Driver for SQL Server 4.0
  • OLE DB Driver for SQL Server
  • SQL Server Native client for OLE DB
Therefore, the client application that uses these drivers or providers does not know that the transaction is "in-doubt." An "in-doubt" transaction means that it could have been committed and hardened to disk successfully, or it is aborted and rolled back by SQL Server. If this "in-doubt" transaction is rolled back, these drivers or providers may still regard the transaction as successfully committed because they cannot capture the exception. This can cause an application data inconsistency issue.

Note The following connection providers can capture the "remote hardening failure" exception for the "in-doubt" transactions:
  • Microsoft ODBC driver for SQL Server
  • SQL Server Native Client (ODBC)

Resolution

This issue was first fixed in the following cumulative update of SQL Server.

Cumulative Update 5 for SQL Server 2014

About cumulative updates for SQL Server

Hotfix information

This hotfix introduces a new trace flag 3923. The trace flag will let SQL Server throw an exception to the application when the 3303 warning message is raised.

After you apply the hotfix, you have to enable this trace flag to resolve this issue. With the hotfix and the trace flag, the application also needs to implement validation codes to check whether the transaction is rolled back or committed after the exception is captured.

A supported hotfix is available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem.

If the hotfix is available for download, there is a "Hotfix Download Available" section at the top of this Knowledge Base article. If this section does not appear, submit a request to Microsoft Customer Service and Support to obtain the hotfix.

Note If additional issues occur or if any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. For a complete list of Microsoft Customer Service and Support telephone numbers or to create a separate service request, visit the following Microsoft website: Note The "Hotfix Download Available" form displays the languages for which the hotfix is available. If you do not see your language, it is because a hotfix is not available for that language.

Restart requirement

You do not have to restart the computer after you apply this hotfix.




Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
Properties

Article ID: 3014867 - Last Review: Dec 17, 2014 - Revision: 1

Microsoft SQL Server 2014 Enterprise, Microsoft SQL Server 2014 Enterprise, Microsoft SQL Server 2014 Enterprise, Microsoft SQL Server 2014 Enterprise, Microsoft SQL Server 2014 Developer, Microsoft SQL Server 2014 Developer, Microsoft SQL Server 2014 Developer, Microsoft SQL Server 2014 Developer, Microsoft SQL Server 2014 Standard, Microsoft SQL Server 2014 Standard, Microsoft SQL Server 2014 Standard, Microsoft SQL Server 2014 Standard

Feedback