none
How does the peer to peer replication resolve the conflict?

    Question

  • Hello,

    Suppose there's 3 sites in p2p replication, how dose the system handle with conflict if two of the sites update same row at the same time?

    will it be error directly?

    Suppose the environment is 2k8 r2

    Much thanks!


    • Edited by AlexLiu2013 Tuesday, July 23, 2013 10:04 AM
    Tuesday, July 23, 2013 9:49 AM

Answers

  • By default, publication property @p2p_continue_onconflict is set to false.  If a conflict occurs, the Distribution agent will stop and an alert will be raised.  At this point, manual intervention will be required and reinitialization is recommended.

    If publication property @p2p_continue_onconflict is set to true, if a conflict occurs, the Distribution agent will continue and the conflict will be resolved based on the Orginator ID value, the row that originated at the node with the highest ID wins the conflict.

    For example, lets say we have node 1 (Originator ID 1) and node 2 (Originator ID 2).  If the same row is updated between polling intervals at node 1 and node 2 - and a conflict occurs, the row from node 1 will persist when @p2p_continue_onconflict is set to true.

    This is covered in Conflict Detection in Peer-to-Peer Replication

    Even with publication property @p2p_continue_onconflict set to true, you should still try to avoid conflicts by partitioning the writes so that write operations for a particular row are performed at only one node.


    Brandon Williams (blog | linkedin)

    Tuesday, July 23, 2013 3:12 PM
  • 1) the conflict will be skipped. By default an error should be raised and the distribution agent will fail until it is fixed. With continue_on_conflict setting set to true, the offending change will be thrown away.

    2) Article filters can be used. Is this what you are referring to? If so, no.

    3) With Merge Replication the first change to the publisher will be persisted throughout the topology.


    looking for a book on SQL Server 2008 Administration? http://www.amazon.com/Microsoft-Server-2008-Management-Administration/dp/067233044X looking for a book on SQL Server 2008 Full-Text Search? http://www.amazon.com/Pro-Full-Text-Search-Server-2008/dp/1430215941

    • Marked as answer by AlexLiu2013 Saturday, July 27, 2013 7:55 AM
    Friday, July 26, 2013 5:08 PM

All replies

  • Hi,

    The below link might help you,

    http://technet.microsoft.com/en-us/library/bb934199.aspx


    Thanks & Regards RAJUKIRAN L Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers.

    Tuesday, July 23, 2013 11:29 AM
  • By default, publication property @p2p_continue_onconflict is set to false.  If a conflict occurs, the Distribution agent will stop and an alert will be raised.  At this point, manual intervention will be required and reinitialization is recommended.

    If publication property @p2p_continue_onconflict is set to true, if a conflict occurs, the Distribution agent will continue and the conflict will be resolved based on the Orginator ID value, the row that originated at the node with the highest ID wins the conflict.

    For example, lets say we have node 1 (Originator ID 1) and node 2 (Originator ID 2).  If the same row is updated between polling intervals at node 1 and node 2 - and a conflict occurs, the row from node 1 will persist when @p2p_continue_onconflict is set to true.

    This is covered in Conflict Detection in Peer-to-Peer Replication

    Even with publication property @p2p_continue_onconflict set to true, you should still try to avoid conflicts by partitioning the writes so that write operations for a particular row are performed at only one node.


    Brandon Williams (blog | linkedin)

    Tuesday, July 23, 2013 3:12 PM
  • By default, publication property @p2p_continue_onconflict is set to false.  If a conflict occurs, the Distribution agent will stop and an alert will be raised.  At this point, manual intervention will be required and reinitialization is recommended.

    If publication property @p2p_continue_onconflict is set to true, if a conflict occurs, the Distribution agent will continue and the conflict will be resolved based on the Orginator ID value, the row that originated at the node with the highest ID wins the conflict.

    For example, lets say we have node 1 (Originator ID 1) and node 2 (Originator ID 2).  If the same row is updated between polling intervals at node 1 and node 2 - and a conflict occurs, the row from node 1 will persist when @p2p_continue_onconflict is set to true.


    Hi,

    Thanks for your detail reply, that's really help, however, I still have two questions about conflict,

    1.  if @p2p_continue_onconflict is set to true, there won't be any conflict worn , isn't it?

    2. P2p replication can't use filter when create the publisher, am I correct? 

    3. How the merge replication handle the conflict between two same priority subscribers(server)?

    Also base on the Originator ID 1(the first subscriber which connect to the publisher), isn't it? 

    Actually , I conclude it from my POC, but I still want to get an official note from such master like you..  :)

    Much Thanks

    best regards 



    • Edited by AlexLiu2013 Wednesday, July 24, 2013 9:08 AM update the question
    Wednesday, July 24, 2013 3:22 AM
  • Any update?
    Friday, July 26, 2013 1:47 AM
  • 1) the conflict will be skipped. By default an error should be raised and the distribution agent will fail until it is fixed. With continue_on_conflict setting set to true, the offending change will be thrown away.

    2) Article filters can be used. Is this what you are referring to? If so, no.

    3) With Merge Replication the first change to the publisher will be persisted throughout the topology.


    looking for a book on SQL Server 2008 Administration? http://www.amazon.com/Microsoft-Server-2008-Management-Administration/dp/067233044X looking for a book on SQL Server 2008 Full-Text Search? http://www.amazon.com/Pro-Full-Text-Search-Server-2008/dp/1430215941

    • Marked as answer by AlexLiu2013 Saturday, July 27, 2013 7:55 AM
    Friday, July 26, 2013 5:08 PM