From 3a96268e97b5dfc9ad798eeb6d44d2d20ada6d76 Mon Sep 17 00:00:00 2001 From: Kalvin Date: Mon, 13 May 2024 21:00:18 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E4=B8=AD=E5=86=8D=E6=AC=A1?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E4=B8=B4=E6=97=B6=E8=8A=82=E7=82=B9=E6=97=B6?= =?UTF-8?q?=E5=B0=86zk=E7=89=88=E6=9C=AC=E8=AE=BE=E7=BD=AE=E4=B8=BA0=20(#9?= =?UTF-8?q?2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: kalvinzhang --- client/cluster_canal_connector.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/cluster_canal_connector.go b/client/cluster_canal_connector.go index 5d411a6..49ec102 100644 --- a/client/cluster_canal_connector.go +++ b/client/cluster_canal_connector.go @@ -3,12 +3,13 @@ package client import ( "errors" "fmt" - "github.com/go-zookeeper/zk" "log" "sort" "strings" "time" + "github.com/go-zookeeper/zk" + pb "github.com/withlin/canal-go/protocol" ) @@ -284,6 +285,8 @@ func (cc *ClusterCanalConnector) waitBecomeFirst() error { if err != nil { return err } + // 再次创建临时节点成功后将版本设置为0,不然后续更新节点会出现版本冲突 + cc.zkVersion = 0 return cc.waitBecomeFirst() } }