SQL Server – How to Troubleshoot Merge Replication Conflict

merge-replicationreplicationsql server

I have SQL Server 2008 R2 Merge Replication setup.

I have 2 publications for the same database with 20+ subscribers.

The logic of our application prevents changing the same data from 2 subscribers at the same time.

Lately I started getting conflicts for some specific tables & almost all the time the contents of the 2 conflicting rows ( the publication row & the subscriber row ) are identical with no differences at all!!

My question is: What is the standard steps to troubleshoot conflicts & trace down to the point that is causing it?

Best Answer

You need to inspect the Conflict Viewer and observe the conflict types and the conflicting row values. Something to note is that the Conflict Winner column will display the winning row values which are pulled from the base tables. If you think about it, these values are volatile and can change, so the values you see in the Conflict Winner column may not be the values they were when the conflict occurred, keep this in mind. The Conflict Loser column will display the losing row values which are pulled from the MSmerge_conflict_publication_article table and these values are static.

If you are unable to determine the root cause of the conflicts based on the Conflict Viewer, you may need to implement an auditing scheme. I have provided an example of how to do this in Auditing Changes in Merge Replication.

There is a small chance you are getting false conflicts but auditing should reveal whether or not that is the case.