Merge replication allows multiple nodes to make autonomous data changes, so situations exist in which a change made at one node may conflict with a change made to the same data at another node. In other situations, the Merge Agent encounters an error such as a constraint violation and cannot propagate a change made at a particular node to another node.
The Merge Agent detects conflicts by using the lineage column of theMSmerge_contents system table; if column-level tracking is enabled for an article, theCOLV1 column is also used. These columns contain metadata about when a row orcolumn is inserted or updated, and about which nodes in a merge replication topology made changes to the row or column. You can use the system stored proceduresp_showrowreplicainfo (Transact-SQL) to view this metadata.
As the Merge Agent enumerates changes to be applied during synchronization, it compares the metadata for each row at the Publisher and Subscriber. The Merge Agent uses this metadata to determine if a row or column has changed at more than one node in the topology, which indicates a potential conflict. After a conflict is detected, the Merge Agent launches the conflict resolver specified for the article with a conflict and uses the resolver to determine the conflict winner. The winning row is applied at the Publisher and Subscriber, and the data from the losing row is written to a conflict table.
Conflicts are resolved automatically and immediately by the Merge Agent unless you have chosen interactive conflict
resolution for the article.
Submitted questions and answers are subject to review and editing, and may or may not be selected for posting, at the sole discretion of w3Sniff.
Get Started
Comments
Leave a Comment