From 4904a0c5e8bb9542303a0b20df220b8412df980f Mon Sep 17 00:00:00 2001 From: Aadi Sanghani Date: Mon, 28 Oct 2024 13:59:48 -0400 Subject: [PATCH] Change zk client --- go.mod | 2 +- go.sum | 4 ++-- go/cmd/zk/command/cat.go | 2 +- go/cmd/zk/command/edit.go | 2 +- go/cmd/zk/command/ls.go | 2 +- go/cmd/zk/command/rm.go | 2 +- go/cmd/zk/command/stat.go | 2 +- go/cmd/zk/command/touch.go | 2 +- go/cmd/zk/command/unzip.go | 2 +- go/cmd/zk/command/wait.go | 2 +- go/cmd/zk/command/watch.go | 2 +- go/cmd/zk/internal/zkfilepath/zkfilepath.go | 2 +- go/cmd/zk/internal/zkfs/zkfs.go | 2 +- go/vt/topo/zk2topo/election.go | 2 +- go/vt/topo/zk2topo/error.go | 2 +- go/vt/topo/zk2topo/file.go | 2 +- go/vt/topo/zk2topo/lock.go | 2 +- go/vt/topo/zk2topo/utils.go | 2 +- go/vt/topo/zk2topo/zk_conn.go | 4 ++-- go/vt/zkctl/zkctl.go | 2 +- vitess-mixin/go.mod | 2 ++ vitess-mixin/go.sum | 2 +- 22 files changed, 25 insertions(+), 23 deletions(-) diff --git a/go.mod b/go.mod index 76b4d86ac11..6547740e5d9 100644 --- a/go.mod +++ b/go.mod @@ -65,7 +65,6 @@ require ( github.com/uber/jaeger-client-go v2.30.0+incompatible github.com/uber/jaeger-lib v2.4.1+incompatible // indirect github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 - github.com/z-division/go-zookeeper v1.0.0 go.etcd.io/etcd/api/v3 v3.5.12 go.etcd.io/etcd/client/pkg/v3 v3.5.12 go.etcd.io/etcd/client/v3 v3.5.12 @@ -96,6 +95,7 @@ require ( github.com/Shopify/toxiproxy/v2 v2.5.0 github.com/bndr/gotabulate v1.1.2 github.com/gammazero/deque v0.2.1 + github.com/go-zookeeper/zk v1.0.4 github.com/google/safehtml v0.1.0 github.com/hashicorp/go-version v1.6.0 github.com/kr/pretty v0.3.1 diff --git a/go.sum b/go.sum index dca29e4e3f5..556e69071c0 100644 --- a/go.sum +++ b/go.sum @@ -152,6 +152,8 @@ github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrt github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/go-zookeeper/zk v1.0.4 h1:DPzxraQx7OrPyXq2phlGlNSIyWEsAox0RJmjTseMV6I= +github.com/go-zookeeper/zk v1.0.4/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -515,8 +517,6 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/z-division/go-zookeeper v1.0.0 h1:ULsCj0nP6+U1liDFWe+2oEF6o4amixoDcDlwEUghVUY= -github.com/z-division/go-zookeeper v1.0.0/go.mod h1:6X4UioQXpvyezJJl4J9NHAJKsoffCwy5wCaaTktXjOA= go.etcd.io/etcd/api/v3 v3.5.12 h1:W4sw5ZoU2Juc9gBWuLk5U6fHfNVyY1WC5g9uiXZio/c= go.etcd.io/etcd/api/v3 v3.5.12/go.mod h1:Ot+o0SWSyT6uHhA56al1oCED0JImsRiU9Dc26+C2a+4= go.etcd.io/etcd/client/pkg/v3 v3.5.12 h1:EYDL6pWwyOsylrQyLp2w+HkQ46ATiOvoEdMarindU2A= diff --git a/go/cmd/zk/command/cat.go b/go/cmd/zk/command/cat.go index 1d5460f7006..486f5bd8589 100644 --- a/go/cmd/zk/command/cat.go +++ b/go/cmd/zk/command/cat.go @@ -20,8 +20,8 @@ import ( "fmt" "os" + "github.com/go-zookeeper/zk" "github.com/spf13/cobra" - "github.com/z-division/go-zookeeper/zk" "golang.org/x/term" "vitess.io/vitess/go/cmd/zk/internal/zkfilepath" diff --git a/go/cmd/zk/command/edit.go b/go/cmd/zk/command/edit.go index ec4b74c4b62..370ec915d1c 100644 --- a/go/cmd/zk/command/edit.go +++ b/go/cmd/zk/command/edit.go @@ -24,8 +24,8 @@ import ( "path" "time" + "github.com/go-zookeeper/zk" "github.com/spf13/cobra" - "github.com/z-division/go-zookeeper/zk" "vitess.io/vitess/go/cmd/zk/internal/zkfilepath" "vitess.io/vitess/go/vt/log" diff --git a/go/cmd/zk/command/ls.go b/go/cmd/zk/command/ls.go index 83c1d31363b..e62886beb62 100644 --- a/go/cmd/zk/command/ls.go +++ b/go/cmd/zk/command/ls.go @@ -22,8 +22,8 @@ import ( "sort" "sync" + "github.com/go-zookeeper/zk" "github.com/spf13/cobra" - "github.com/z-division/go-zookeeper/zk" "vitess.io/vitess/go/cmd/zk/internal/zkfilepath" "vitess.io/vitess/go/vt/log" diff --git a/go/cmd/zk/command/rm.go b/go/cmd/zk/command/rm.go index 5e5b5f4c494..0642f98643d 100644 --- a/go/cmd/zk/command/rm.go +++ b/go/cmd/zk/command/rm.go @@ -20,8 +20,8 @@ import ( "fmt" "strings" + "github.com/go-zookeeper/zk" "github.com/spf13/cobra" - "github.com/z-division/go-zookeeper/zk" "vitess.io/vitess/go/cmd/zk/internal/zkfilepath" "vitess.io/vitess/go/vt/log" diff --git a/go/cmd/zk/command/stat.go b/go/cmd/zk/command/stat.go index 713a68a3d4e..3f816e81680 100644 --- a/go/cmd/zk/command/stat.go +++ b/go/cmd/zk/command/stat.go @@ -19,8 +19,8 @@ package command import ( "fmt" + "github.com/go-zookeeper/zk" "github.com/spf13/cobra" - "github.com/z-division/go-zookeeper/zk" "vitess.io/vitess/go/cmd/zk/internal/zkfilepath" "vitess.io/vitess/go/cmd/zk/internal/zkfs" diff --git a/go/cmd/zk/command/touch.go b/go/cmd/zk/command/touch.go index 76c390cf169..079d2a72a7a 100644 --- a/go/cmd/zk/command/touch.go +++ b/go/cmd/zk/command/touch.go @@ -19,8 +19,8 @@ package command import ( "fmt" + "github.com/go-zookeeper/zk" "github.com/spf13/cobra" - "github.com/z-division/go-zookeeper/zk" "vitess.io/vitess/go/cmd/zk/internal/zkfilepath" "vitess.io/vitess/go/vt/topo/zk2topo" diff --git a/go/cmd/zk/command/unzip.go b/go/cmd/zk/command/unzip.go index f4c800e0533..b056d1f2658 100644 --- a/go/cmd/zk/command/unzip.go +++ b/go/cmd/zk/command/unzip.go @@ -23,8 +23,8 @@ import ( "path" "strings" + "github.com/go-zookeeper/zk" "github.com/spf13/cobra" - "github.com/z-division/go-zookeeper/zk" "vitess.io/vitess/go/vt/topo/zk2topo" ) diff --git a/go/cmd/zk/command/wait.go b/go/cmd/zk/command/wait.go index 864f6e83626..fb9cc90cede 100644 --- a/go/cmd/zk/command/wait.go +++ b/go/cmd/zk/command/wait.go @@ -19,8 +19,8 @@ package command import ( "fmt" + "github.com/go-zookeeper/zk" "github.com/spf13/cobra" - "github.com/z-division/go-zookeeper/zk" "vitess.io/vitess/go/cmd/zk/internal/zkfilepath" ) diff --git a/go/cmd/zk/command/watch.go b/go/cmd/zk/command/watch.go index eb28cc29ca2..942203d429f 100644 --- a/go/cmd/zk/command/watch.go +++ b/go/cmd/zk/command/watch.go @@ -19,8 +19,8 @@ package command import ( "fmt" + "github.com/go-zookeeper/zk" "github.com/spf13/cobra" - "github.com/z-division/go-zookeeper/zk" "vitess.io/vitess/go/cmd/zk/internal/zkfilepath" "vitess.io/vitess/go/vt/log" diff --git a/go/cmd/zk/internal/zkfilepath/zkfilepath.go b/go/cmd/zk/internal/zkfilepath/zkfilepath.go index 7febc7a9677..07314905411 100644 --- a/go/cmd/zk/internal/zkfilepath/zkfilepath.go +++ b/go/cmd/zk/internal/zkfilepath/zkfilepath.go @@ -22,7 +22,7 @@ import ( "path" "strings" - "github.com/z-division/go-zookeeper/zk" + "github.com/go-zookeeper/zk" "vitess.io/vitess/go/vt/topo/zk2topo" ) diff --git a/go/cmd/zk/internal/zkfs/zkfs.go b/go/cmd/zk/internal/zkfs/zkfs.go index 9bab19ec1e4..60ec23bdf36 100644 --- a/go/cmd/zk/internal/zkfs/zkfs.go +++ b/go/cmd/zk/internal/zkfs/zkfs.go @@ -26,7 +26,7 @@ import ( "strings" "syscall" - "github.com/z-division/go-zookeeper/zk" + "github.com/go-zookeeper/zk" "vitess.io/vitess/go/cmd/zk/internal/zkfilepath" "vitess.io/vitess/go/vt/topo/zk2topo" diff --git a/go/vt/topo/zk2topo/election.go b/go/vt/topo/zk2topo/election.go index e82a31d0756..05195c938fd 100644 --- a/go/vt/topo/zk2topo/election.go +++ b/go/vt/topo/zk2topo/election.go @@ -21,7 +21,7 @@ import ( "path" "sort" - "github.com/z-division/go-zookeeper/zk" + "github.com/go-zookeeper/zk" "vitess.io/vitess/go/vt/vterrors" diff --git a/go/vt/topo/zk2topo/error.go b/go/vt/topo/zk2topo/error.go index 1ebc3896f40..63572369cdc 100644 --- a/go/vt/topo/zk2topo/error.go +++ b/go/vt/topo/zk2topo/error.go @@ -19,7 +19,7 @@ package zk2topo import ( "context" - "github.com/z-division/go-zookeeper/zk" + "github.com/go-zookeeper/zk" "vitess.io/vitess/go/vt/topo" ) diff --git a/go/vt/topo/zk2topo/file.go b/go/vt/topo/zk2topo/file.go index d0cbdee7ae4..cc18eebeda7 100644 --- a/go/vt/topo/zk2topo/file.go +++ b/go/vt/topo/zk2topo/file.go @@ -23,7 +23,7 @@ import ( "context" - "github.com/z-division/go-zookeeper/zk" + "github.com/go-zookeeper/zk" "vitess.io/vitess/go/vt/topo" ) diff --git a/go/vt/topo/zk2topo/lock.go b/go/vt/topo/zk2topo/lock.go index 5baf1f7f33f..79d74ca094d 100644 --- a/go/vt/topo/zk2topo/lock.go +++ b/go/vt/topo/zk2topo/lock.go @@ -21,7 +21,7 @@ import ( "fmt" "path" - "github.com/z-division/go-zookeeper/zk" + "github.com/go-zookeeper/zk" "vitess.io/vitess/go/vt/vterrors" diff --git a/go/vt/topo/zk2topo/utils.go b/go/vt/topo/zk2topo/utils.go index 08c95e60450..903d1eaa7d1 100644 --- a/go/vt/topo/zk2topo/utils.go +++ b/go/vt/topo/zk2topo/utils.go @@ -25,7 +25,7 @@ import ( "context" - "github.com/z-division/go-zookeeper/zk" + "github.com/go-zookeeper/zk" "vitess.io/vitess/go/vt/log" "vitess.io/vitess/go/vt/vterrors" diff --git a/go/vt/topo/zk2topo/zk_conn.go b/go/vt/topo/zk2topo/zk_conn.go index a0eec8b4340..a95d3f593ea 100644 --- a/go/vt/topo/zk2topo/zk_conn.go +++ b/go/vt/topo/zk2topo/zk_conn.go @@ -28,8 +28,8 @@ import ( "sync" "time" + "github.com/go-zookeeper/zk" "github.com/spf13/pflag" - "github.com/z-division/go-zookeeper/zk" "golang.org/x/sync/semaphore" "vitess.io/vitess/go/vt/log" @@ -393,7 +393,7 @@ func dialZk(ctx context.Context, addr string) (*zk.Conn, <-chan zk.Event, error) } // Make sure we re-resolve the DNS name every time we reconnect to a server // In environments where DNS changes such as Kubernetes we can't cache the IP address - hostProvider := zk.WithHostProvider(&zk.SimpleDNSHostProvider{}) + hostProvider := zk.WithHostProvider(&zk.DNSHostProvider{}) // zk.Connect automatically shuffles the servers zconn, session, err := zk.Connect(servers, baseTimeout, dialer, hostProvider) diff --git a/go/vt/zkctl/zkctl.go b/go/vt/zkctl/zkctl.go index acb8dba6356..082493298f8 100644 --- a/go/vt/zkctl/zkctl.go +++ b/go/vt/zkctl/zkctl.go @@ -31,7 +31,7 @@ import ( "syscall" "time" - zookeeper "github.com/z-division/go-zookeeper/zk" + zookeeper "github.com/go-zookeeper/zk" "vitess.io/vitess/go/vt/env" "vitess.io/vitess/go/vt/log" diff --git a/vitess-mixin/go.mod b/vitess-mixin/go.mod index d38b8bc4d80..755875f6894 100644 --- a/vitess-mixin/go.mod +++ b/vitess-mixin/go.mod @@ -18,3 +18,5 @@ require ( ) replace k8s.io/client-go v2.0.0-alpha.0.0.20181121191925-a47917edff34+incompatible => k8s.io/client-go v2.0.0-alpha.1+incompatible + +replace github.com/z-division/go-zookeeper => github.com/go-zookeeper/zk v1.0.4 \ No newline at end of file diff --git a/vitess-mixin/go.sum b/vitess-mixin/go.sum index c419ab2ccae..269fe78d489 100644 --- a/vitess-mixin/go.sum +++ b/vitess-mixin/go.sum @@ -789,6 +789,7 @@ github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/me github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= +github.com/go-zookeeper/zk v1.0.4/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw= github.com/gocql/gocql v0.0.0-20220224095938-0eacd3183625/go.mod h1:3gM2c4D3AnkISwBxGnMMsS8Oy4y2lhbPRsH4xnJrHG8= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofiber/fiber/v2 v2.24.0/go.mod h1:MR1usVH3JHYRyQwMe2eZXRSZHRX38fkV+A7CPB+DlDQ= @@ -1569,7 +1570,6 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/z-division/go-zookeeper v1.0.0/go.mod h1:6X4UioQXpvyezJJl4J9NHAJKsoffCwy5wCaaTktXjOA= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= github.com/zenazn/goji v1.0.1/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=