Skip to content

Commit 3a96268

Browse files
kalvinzhangkalvinzhang
andauthored
连接中再次创建临时节点时将zk版本设置为0 (#92)
Co-authored-by: kalvinzhang <kalvinzhang@futunn.com>
1 parent bc338ee commit 3a96268

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

client/cluster_canal_connector.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ package client
33
import (
44
"errors"
55
"fmt"
6-
"github.com/go-zookeeper/zk"
76
"log"
87
"sort"
98
"strings"
109
"time"
1110

11+
"github.com/go-zookeeper/zk"
12+
1213
pb "github.com/withlin/canal-go/protocol"
1314
)
1415

@@ -284,6 +285,8 @@ func (cc *ClusterCanalConnector) waitBecomeFirst() error {
284285
if err != nil {
285286
return err
286287
}
288+
// 再次创建临时节点成功后将版本设置为0,不然后续更新节点会出现版本冲突
289+
cc.zkVersion = 0
287290
return cc.waitBecomeFirst()
288291
}
289292
}

0 commit comments

Comments
 (0)