Skip to content

Commit

Permalink
连接中再次创建临时节点时将zk版本设置为0 (#92)
Browse files Browse the repository at this point in the history
Co-authored-by: kalvinzhang <[email protected]>
  • Loading branch information
kalvinzhang and kalvinzhang authored May 13, 2024
1 parent bc338ee commit 3a96268
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion client/cluster_canal_connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

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

0 comments on commit 3a96268

Please sign in to comment.