|
|
具体到你这个case,macrozeng 老兄先把表和复制的定义来贴上来让大家先看看吧.具体场景不清楚,感觉就像打醉拳
对于双向sql复制,冲突检测有两种:
Standard detection :
The Apply program checks for conflicts based on the changes captured to this point. The Apply program will reverse any conflicting transaction at the replica, as well as any transactions with dependencies on the conflicting transaction. Changes captured after the Apply program begins conflict detection will not be checked during this Apply cycle.
Enhanced detection :
The Apply program waits until the Capture program captures all changes from the log or journal (see description of the SYNCHTIME column) and then does a standard conflict detection as when set to 1. During the wait time, the Apply program holds a LOCK on the source tables to ensure that no changes are made during the conflict detection process.
原理类似:
During each Apply cycle, the Apply program compares the key values in the master’s CD table with those in the replica’s CD table. If the same key value exists in both CD tables, it is a conflict. In case of a conflict, the Apply program will undo the transaction that was previously committed at the replica by reading from the replica’s CD table and keeping only the changes that originated at the master.
如果诚如macrozeng 所说这个case是由于同时插入或者更新造成的,那要不设置conflict detection,手动删除一两条数据解决一个具体conflict也是治标不治本的,不能避免以后还发生类似情况 |
|