diff --git a/go.mod b/go.mod index ab585f92..c945aec7 100644 --- a/go.mod +++ b/go.mod @@ -2,19 +2,21 @@ module github.com/datastax/zdm-proxy go 1.24 +replace github.com/apache/cassandra-gocql-driver/v2 v2.0.0-rc1 => github.com/joao-r-reis/cassandra-gocql-driver/v2 v2.0.0-rc1.0.20250828164857-9a6d631102fa + require ( github.com/antlr4-go/antlr/v4 v4.13.1 + github.com/apache/cassandra-gocql-driver/v2 v2.0.0-rc1 github.com/datastax/go-cassandra-native-protocol v0.0.0-20240626123646-2abea740da8d - github.com/gocql/gocql v0.0.0-20200624222514-34081eda590e github.com/google/uuid v1.1.1 github.com/jpillora/backoff v1.0.0 github.com/kelseyhightower/envconfig v1.4.0 github.com/mcuadros/go-defaults v1.2.0 github.com/prometheus/client_golang v1.11.1 github.com/prometheus/client_model v0.2.0 - github.com/rs/zerolog v1.20.0 + github.com/rs/zerolog v1.34.0 github.com/sirupsen/logrus v1.6.0 - github.com/stretchr/testify v1.8.0 + github.com/stretchr/testify v1.9.0 golang.org/x/time v0.12.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -25,16 +27,17 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/golang/protobuf v1.5.0 // indirect github.com/golang/snappy v0.0.3 // indirect - github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed // indirect github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect - github.com/kr/pretty v0.2.1 // indirect + github.com/kr/text v0.2.0 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.19 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect - github.com/pierrec/lz4/v4 v4.0.3 // indirect + github.com/pierrec/lz4/v4 v4.1.8 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/common v0.26.0 // indirect github.com/prometheus/procfs v0.6.0 // indirect golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect - golang.org/x/sys v0.3.0 // indirect + golang.org/x/sys v0.12.0 // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect ) diff --git a/go.sum b/go.sum index e273a478..5fc8586e 100644 --- a/go.sum +++ b/go.sum @@ -10,13 +10,10 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bitly/go-hostpool v0.0.0-20171023180738-a3a6125de932 h1:mXoPYz/Ul5HYEDvkta6I8/rnYM5gSdSV2tJ6XbZuEtY= -github.com/bitly/go-hostpool v0.0.0-20171023180738-a3a6125de932/go.mod h1:NOuUCSz6Q9T7+igc/hlvDOUdtWKryOrtFyIVABv/p7k= -github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= -github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/datastax/go-cassandra-native-protocol v0.0.0-20240626123646-2abea740da8d h1:UnPtAA8Ux3GvHLazSSUydERFuoQRyxHrB8puzXyjXIE= github.com/datastax/go-cassandra-native-protocol v0.0.0-20240626123646-2abea740da8d/go.mod h1:6FzirJfdffakAVqmHjwVfFkpru/gNbIazUOK5rIhndc= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -29,8 +26,7 @@ github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9 github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/gocql/gocql v0.0.0-20200624222514-34081eda590e h1:SroDcndcOU9BVAduPf/PXihXoR2ZYTQYLXbupbqxAyQ= -github.com/gocql/gocql v0.0.0-20200624222514-34081eda590e/go.mod h1:DL0ekTmBSTdlNF25Orwt/JMzqIq3EJ4MVa/J/uK64OY= +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/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -44,7 +40,6 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0 h1:LUVKkCeviFUMKqHa4tXIIij/lbhnMbP7Fn5wKdKkRh4= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -57,8 +52,8 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed h1:5upAirOpQc1Q53c0bnx2ufif5kANL7bfZWcc6VJWJd8= -github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4= +github.com/joao-r-reis/cassandra-gocql-driver/v2 v2.0.0-rc1.0.20250828164857-9a6d631102fa h1:/pWx0qQ9VoZI3ULEi4G1aEhLAzgZ+Ay1P6Ze9xlUlDA= +github.com/joao-r-reis/cassandra-gocql-driver/v2 v2.0.0-rc1.0.20250828164857-9a6d631102fa/go.mod h1:QH/asJjB3mHvY6Dot6ZKMMpTcOrWJ8i9GhsvG1g0PK4= github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= @@ -73,11 +68,15 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJ github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mcuadros/go-defaults v1.2.0 h1:FODb8WSf0uGaY8elWJAkoLL0Ri6AlZ1bFlenk56oZtc= @@ -90,8 +89,8 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/pierrec/lz4/v4 v4.0.3 h1:vNQKSVZNYUEAvRY9FaUXAF1XPbSOHJtDTiP41kzDz2E= -github.com/pierrec/lz4/v4 v4.0.3/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pierrec/lz4/v4 v4.1.8 h1:ieHkV+i2BRzngO4Wd/3HGowuZStgq6QkPsD1eolNAO4= +github.com/pierrec/lz4/v4 v4.1.8/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -115,23 +114,22 @@ github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsT github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= -github.com/rs/zerolog v1.20.0 h1:38k9hgtUBdxFwE34yS8rTHmHBa4eN16E4DJlv177LNs= -github.com/rs/zerolog v1.20.0/go.mod h1:IzD0RJ65iWH0w97OQQebJEvTZYvsCUm9WVLWBQrJRjo= +github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0= +github.com/rs/zerolog v1.34.0 h1:k43nTLIwcTVQAncfCw4KZ2VY6ukYoZaBPNOE8txlOeY= +github.com/rs/zerolog v1.34.0/go.mod h1:bJsvje4Z08ROH4Nhs5iH600c3IkWhwp44iRc54W6wYQ= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -142,12 +140,10 @@ golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -161,15 +157,15 @@ golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= -golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE= golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190828213141-aed303cbaa74/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -193,6 +189,5 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/integration-tests/asyncreads_test.go b/integration-tests/asyncreads_test.go index d487f2aa..ff4ff12d 100644 --- a/integration-tests/asyncreads_test.go +++ b/integration-tests/asyncreads_test.go @@ -3,6 +3,7 @@ package integration_tests import ( "context" "fmt" + "github.com/apache/cassandra-gocql-driver/v2" "github.com/datastax/go-cassandra-native-protocol/client" "github.com/datastax/go-cassandra-native-protocol/frame" "github.com/datastax/go-cassandra-native-protocol/message" @@ -11,7 +12,6 @@ import ( "github.com/datastax/zdm-proxy/integration-tests/simulacron" "github.com/datastax/zdm-proxy/integration-tests/utils" "github.com/datastax/zdm-proxy/proxy/pkg/config" - "github.com/gocql/gocql" "github.com/rs/zerolog" log "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" diff --git a/integration-tests/basicbatch_test.go b/integration-tests/basicbatch_test.go index 1d265fbb..3918b703 100644 --- a/integration-tests/basicbatch_test.go +++ b/integration-tests/basicbatch_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/require" "testing" - "github.com/gocql/gocql" + "github.com/apache/cassandra-gocql-driver/v2" ) // BasicBatch tests basic batch statement functionality diff --git a/integration-tests/basicupdate_test.go b/integration-tests/basicupdate_test.go index d302035c..d5dbd717 100644 --- a/integration-tests/basicupdate_test.go +++ b/integration-tests/basicupdate_test.go @@ -2,13 +2,15 @@ package integration_tests import ( "fmt" + "testing" + + "github.com/apache/cassandra-gocql-driver/v2/snappy" + log "github.com/sirupsen/logrus" + "github.com/stretchr/testify/require" + "github.com/datastax/zdm-proxy/integration-tests/env" "github.com/datastax/zdm-proxy/integration-tests/setup" "github.com/datastax/zdm-proxy/integration-tests/utils" - "github.com/gocql/gocql" - log "github.com/sirupsen/logrus" - "github.com/stretchr/testify/require" - "testing" ) // BasicUpdate tests if update queries run correctly @@ -88,7 +90,7 @@ func TestCompression(t *testing.T) { // Connect to proxy as a "client" cluster := utils.NewCluster("127.0.0.1", "", "", 14002) - cluster.Compressor = gocql.SnappyCompressor{} + cluster.Compressor = snappy.SnappyCompressor{} proxy, err := cluster.CreateSession() if err != nil { diff --git a/integration-tests/batch_test.go b/integration-tests/batch_test.go index 84054b60..16e3c2cc 100644 --- a/integration-tests/batch_test.go +++ b/integration-tests/batch_test.go @@ -1,10 +1,10 @@ package integration_tests import ( + "github.com/apache/cassandra-gocql-driver/v2" "github.com/datastax/zdm-proxy/integration-tests/setup" "github.com/datastax/zdm-proxy/integration-tests/simulacron" "github.com/datastax/zdm-proxy/integration-tests/utils" - "github.com/gocql/gocql" "github.com/stretchr/testify/require" "testing" ) diff --git a/integration-tests/ccm/cluster.go b/integration-tests/ccm/cluster.go index d2b388ef..91461062 100644 --- a/integration-tests/ccm/cluster.go +++ b/integration-tests/ccm/cluster.go @@ -2,8 +2,8 @@ package ccm import ( "fmt" + "github.com/apache/cassandra-gocql-driver/v2" "github.com/datastax/zdm-proxy/integration-tests/env" - "github.com/gocql/gocql" ) type Cluster struct { diff --git a/integration-tests/main_test.go b/integration-tests/main_test.go index c7195f42..6573f872 100644 --- a/integration-tests/main_test.go +++ b/integration-tests/main_test.go @@ -1,20 +1,20 @@ package integration_tests import ( + "os" + "testing" + + log "github.com/sirupsen/logrus" + "github.com/datastax/zdm-proxy/integration-tests/ccm" "github.com/datastax/zdm-proxy/integration-tests/env" "github.com/datastax/zdm-proxy/integration-tests/setup" "github.com/datastax/zdm-proxy/proxy/pkg/zdmproxy" - "github.com/gocql/gocql" - log "github.com/sirupsen/logrus" - "os" - "testing" ) func TestMain(m *testing.M) { env.InitGlobalVars() - gocql.TimeoutLimit = 5 if env.Debug { log.SetLevel(log.DebugLevel) } else { diff --git a/integration-tests/read_test.go b/integration-tests/read_test.go index 909874ac..50c548a6 100644 --- a/integration-tests/read_test.go +++ b/integration-tests/read_test.go @@ -2,18 +2,20 @@ package integration_tests import ( "fmt" + "net" + "strings" + "testing" + + "github.com/stretchr/testify/require" + "github.com/datastax/zdm-proxy/integration-tests/setup" "github.com/datastax/zdm-proxy/integration-tests/simulacron" "github.com/datastax/zdm-proxy/integration-tests/utils" "github.com/datastax/zdm-proxy/proxy/pkg/config" - "github.com/stretchr/testify/require" - "net" - "strings" - "testing" ) -var rpcAddressExpectedPrimed = net.IPv4(192, 168, 1, 1) -var rpcAddressExpectedProxy = net.IPv4(127, 0, 0, 1) +var rpcAddressExpectedPrimed = net.IP{192, 168, 1, 1} +var rpcAddressExpectedProxy = net.IP{127, 0, 0, 1} var rows = simulacron.NewRowsResult( map[string]simulacron.DataType{ @@ -65,13 +67,13 @@ func testForwardDecisionsForReads(t *testing.T, primaryCluster string, systemQue } expectedProxyRow := map[string]interface{}{ - "rpc_address": rpcAddressExpectedProxy.String(), + "rpc_address": rpcAddressExpectedProxy, } expectedAliasedProxyRow := map[string]interface{}{ - "addr": rpcAddressExpectedProxy.String(), + "addr": rpcAddressExpectedProxy, } expectedPrimedRow := map[string]interface{}{ - "rpc_address": rpcAddressExpectedPrimed.String(), + "rpc_address": rpcAddressExpectedPrimed, } tests := []struct { diff --git a/integration-tests/setup/data.go b/integration-tests/setup/data.go index f9e74bbd..b57c157c 100644 --- a/integration-tests/setup/data.go +++ b/integration-tests/setup/data.go @@ -3,7 +3,7 @@ package setup import ( "fmt" - "github.com/gocql/gocql" + "github.com/apache/cassandra-gocql-driver/v2" log "github.com/sirupsen/logrus" ) diff --git a/integration-tests/simulacron/api.go b/integration-tests/simulacron/api.go index d0478ab9..bb8f0a09 100644 --- a/integration-tests/simulacron/api.go +++ b/integration-tests/simulacron/api.go @@ -4,7 +4,7 @@ import ( "bytes" "encoding/json" "fmt" - "github.com/gocql/gocql" + "github.com/apache/cassandra-gocql-driver/v2" "time" ) diff --git a/integration-tests/simulacron/cluster.go b/integration-tests/simulacron/cluster.go index 6423c833..2d394337 100644 --- a/integration-tests/simulacron/cluster.go +++ b/integration-tests/simulacron/cluster.go @@ -3,8 +3,8 @@ package simulacron import ( "encoding/json" "fmt" + "github.com/apache/cassandra-gocql-driver/v2" "github.com/datastax/zdm-proxy/integration-tests/env" - "github.com/gocql/gocql" "net" "strings" ) diff --git a/integration-tests/stress_test.go b/integration-tests/stress_test.go index 772f402f..439dddea 100644 --- a/integration-tests/stress_test.go +++ b/integration-tests/stress_test.go @@ -4,17 +4,19 @@ import ( "context" "errors" "fmt" - "github.com/datastax/zdm-proxy/integration-tests/env" - "github.com/datastax/zdm-proxy/integration-tests/setup" - "github.com/gocql/gocql" - "github.com/rs/zerolog" - log "github.com/sirupsen/logrus" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" "sync" "sync/atomic" "testing" "time" + + "github.com/apache/cassandra-gocql-driver/v2" + "github.com/rs/zerolog" + log "github.com/sirupsen/logrus" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/datastax/zdm-proxy/integration-tests/env" + "github.com/datastax/zdm-proxy/integration-tests/setup" ) func TestSimultaneousConnections(t *testing.T) { @@ -72,6 +74,8 @@ func TestSimultaneousConnections(t *testing.T) { fatalErr := errors.New("fatal err") spawnGoroutinesWg := &sync.WaitGroup{} + var sessions []*gocql.Session + sessionsLock := &sync.Mutex{} for i := 0; i < parallelSessionGoroutines; i++ { spawnGoroutinesWg.Add(1) go func() { @@ -93,7 +97,9 @@ func TestSimultaneousConnections(t *testing.T) { errChan <- fmt.Errorf("%w: %v", fatalErr, err.Error()) return } - defer goCqlSession.Close() + sessionsLock.Lock() + sessions = append(sessions, goCqlSession) + sessionsLock.Unlock() requestWg.Add(1) go func() { defer requestWg.Done() @@ -119,6 +125,13 @@ func TestSimultaneousConnections(t *testing.T) { go func() { defer wg.Done() defer close(errChan) + defer func() { + sessionsLock.Lock() + for _, session := range sessions { + session.Close() + } + sessionsLock.Unlock() + }() spawnGoroutinesWg.Wait() select { case <-time.After(13 * time.Second): @@ -151,6 +164,7 @@ func TestSimultaneousConnections(t *testing.T) { requestWg.Wait() }() + errCounter := 0 for { err, ok := <-errChan if !ok { @@ -166,7 +180,14 @@ func TestSimultaneousConnections(t *testing.T) { assert.Failf(t, "error before shutdown, deadlock?", "%v", err.Error()) testCancelFn() } else { - t.Log(err) + if errors.Is(err, gocql.ErrNoConnections) { + if errCounter%20 == 0 { + t.Log(err) + } + errCounter++ + } else { + t.Log(err) + } } } } diff --git a/integration-tests/utils/testutils.go b/integration-tests/utils/testutils.go index 2c050ecd..3e8a1517 100644 --- a/integration-tests/utils/testutils.go +++ b/integration-tests/utils/testutils.go @@ -4,8 +4,8 @@ import ( "bytes" "encoding/json" "fmt" + "github.com/apache/cassandra-gocql-driver/v2" "github.com/datastax/zdm-proxy/proxy/pkg/health" - "github.com/gocql/gocql" "github.com/rs/zerolog" log "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" diff --git a/integration-tests/virtualization_test.go b/integration-tests/virtualization_test.go index 243080e4..7f25e518 100644 --- a/integration-tests/virtualization_test.go +++ b/integration-tests/virtualization_test.go @@ -3,28 +3,30 @@ package integration_tests import ( "context" "fmt" + "math/big" + "math/rand" + "net" + "sort" + "strings" + "sync" + "testing" + "time" + + "github.com/apache/cassandra-gocql-driver/v2" "github.com/datastax/go-cassandra-native-protocol/client" "github.com/datastax/go-cassandra-native-protocol/datacodec" "github.com/datastax/go-cassandra-native-protocol/frame" "github.com/datastax/go-cassandra-native-protocol/message" "github.com/datastax/go-cassandra-native-protocol/primitive" + "github.com/google/uuid" + log "github.com/sirupsen/logrus" + "github.com/stretchr/testify/require" + "github.com/datastax/zdm-proxy/integration-tests/env" "github.com/datastax/zdm-proxy/integration-tests/setup" "github.com/datastax/zdm-proxy/integration-tests/utils" "github.com/datastax/zdm-proxy/proxy/pkg/config" "github.com/datastax/zdm-proxy/proxy/pkg/zdmproxy" - "github.com/gocql/gocql" - "github.com/google/uuid" - log "github.com/sirupsen/logrus" - "github.com/stretchr/testify/require" - "math/big" - "math/rand" - "net" - "sort" - "strings" - "sync" - "testing" - "time" ) type connectObserver struct { @@ -136,11 +138,10 @@ func TestVirtualizationNumberOfConnections(t *testing.T) { if !exists { counter = 0 } + counter++ + hostsMap[hostAddr.String()] = counter if observedConnect.Err != nil { errors = append(errors, observedConnect.Err) - } else { - counter++ - hostsMap[hostAddr.String()] = counter } hostsMapLock.Unlock() } diff --git a/integration-tests/write_test.go b/integration-tests/write_test.go index cc04fddf..dd76c377 100644 --- a/integration-tests/write_test.go +++ b/integration-tests/write_test.go @@ -6,11 +6,11 @@ import ( "encoding/base64" "encoding/hex" "fmt" + "github.com/apache/cassandra-gocql-driver/v2" "github.com/datastax/go-cassandra-native-protocol/primitive" "github.com/datastax/zdm-proxy/integration-tests/setup" "github.com/datastax/zdm-proxy/integration-tests/simulacron" "github.com/datastax/zdm-proxy/integration-tests/utils" - "github.com/gocql/gocql" log "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" "regexp"