From 0f0f0abbe6c012bf3faf8969e9296ed3727ab580 Mon Sep 17 00:00:00 2001 From: Mantas Sidlauskas Date: Fri, 15 Nov 2024 16:25:30 +0200 Subject: [PATCH 1/4] Bump gocql version to v1.7.0 --- cmd/server/go.mod | 2 +- cmd/server/go.sum | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/server/go.mod b/cmd/server/go.mod index b1b39e81313..3b64bb0b378 100644 --- a/cmd/server/go.mod +++ b/cmd/server/go.mod @@ -21,7 +21,7 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/go-sql-driver/mysql v1.7.1 // indirect - github.com/gocql/gocql v0.0.0-20211015133455-b225f9b53fa1 // indirect + github.com/gocql/gocql v1.7.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/mock v1.6.0 github.com/google/uuid v1.5.0 // indirect diff --git a/cmd/server/go.sum b/cmd/server/go.sum index 69ea9238a86..86d02d734d2 100644 --- a/cmd/server/go.sum +++ b/cmd/server/go.sum @@ -133,8 +133,8 @@ github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9 github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-zookeeper/zk v1.0.3 h1:7M2kwOsc//9VeeFiPtf+uSJlVpU66x9Ba5+8XK7/TDg= github.com/go-zookeeper/zk v1.0.3/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw= -github.com/gocql/gocql v0.0.0-20211015133455-b225f9b53fa1 h1:px9qUCy/RNJNsfCam4m2IxWGxNuimkrioEF0vrrbPsg= -github.com/gocql/gocql v0.0.0-20211015133455-b225f9b53fa1/go.mod h1:3gM2c4D3AnkISwBxGnMMsS8Oy4y2lhbPRsH4xnJrHG8= +github.com/gocql/gocql v1.7.0 h1:O+7U7/1gSN7QTEAaMEsJc1Oq2QHXvCWoF3DFK9HDHus= +github.com/gocql/gocql v1.7.0/go.mod h1:vnlvXyFZeLBF0Wy+RS8hrOdbn0UWsWtdg07XJnFxZ+4= github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.3.2 h1:kX1es4djPJrsDhY7aZKJy7aZasdcB5oSOEphMjSB53c= github.com/gogo/googleapis v1.3.2/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= diff --git a/go.mod b/go.mod index 870bd8f8564..bfb3c1f4dde 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/emirpasic/gods v0.0.0-20190624094223-e689965507ab github.com/fatih/color v1.13.0 github.com/go-sql-driver/mysql v1.7.1 - github.com/gocql/gocql v0.0.0-20211015133455-b225f9b53fa1 + github.com/gocql/gocql v1.7.0 github.com/gogo/protobuf v1.3.2 github.com/golang-jwt/jwt/v5 v5.2.0 github.com/golang/mock v1.6.0 diff --git a/go.sum b/go.sum index 7d6358df6f0..32518e173e0 100644 --- a/go.sum +++ b/go.sum @@ -148,8 +148,8 @@ github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWe github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= -github.com/gocql/gocql v0.0.0-20211015133455-b225f9b53fa1 h1:px9qUCy/RNJNsfCam4m2IxWGxNuimkrioEF0vrrbPsg= -github.com/gocql/gocql v0.0.0-20211015133455-b225f9b53fa1/go.mod h1:3gM2c4D3AnkISwBxGnMMsS8Oy4y2lhbPRsH4xnJrHG8= +github.com/gocql/gocql v1.7.0 h1:O+7U7/1gSN7QTEAaMEsJc1Oq2QHXvCWoF3DFK9HDHus= +github.com/gocql/gocql v1.7.0/go.mod h1:vnlvXyFZeLBF0Wy+RS8hrOdbn0UWsWtdg07XJnFxZ+4= github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.3.2 h1:kX1es4djPJrsDhY7aZKJy7aZasdcB5oSOEphMjSB53c= github.com/gogo/googleapis v1.3.2/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= From c0db24c06fe6b429df45706a3c5c21f6783ab020 Mon Sep 17 00:00:00 2001 From: Mantas Sidlauskas Date: Tue, 19 Nov 2024 14:29:29 +0200 Subject: [PATCH 2/4] handle gocql null map conversion --- common/persistence/nosql/nosqlplugin/cassandra/tasks.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/persistence/nosql/nosqlplugin/cassandra/tasks.go b/common/persistence/nosql/nosqlplugin/cassandra/tasks.go index 77f9af0acad..22a91b70d6c 100644 --- a/common/persistence/nosql/nosqlplugin/cassandra/tasks.go +++ b/common/persistence/nosql/nosqlplugin/cassandra/tasks.go @@ -89,6 +89,11 @@ func toTaskListPartitionConfig(v interface{}) *persistence.TaskListPartitionConf version := partition["version"].(int64) numRead := partition["num_read_partitions"].(int) numWrite := partition["num_write_partitions"].(int) + + if version == 0 && numRead == 0 && numWrite == 0 { + return nil + } + return &persistence.TaskListPartitionConfig{ Version: version, NumReadPartitions: numRead, From 4a98fe61ea3f893c08a678b48ac3fab01ab907de Mon Sep 17 00:00:00 2001 From: Mantas Sidlauskas Date: Thu, 21 Nov 2024 12:32:33 +0200 Subject: [PATCH 3/4] add comment about cassandra nil vs empty struct --- common/persistence/nosql/nosqlplugin/cassandra/tasks.go | 1 + idls | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/common/persistence/nosql/nosqlplugin/cassandra/tasks.go b/common/persistence/nosql/nosqlplugin/cassandra/tasks.go index 22a91b70d6c..bf16288a385 100644 --- a/common/persistence/nosql/nosqlplugin/cassandra/tasks.go +++ b/common/persistence/nosql/nosqlplugin/cassandra/tasks.go @@ -90,6 +90,7 @@ func toTaskListPartitionConfig(v interface{}) *persistence.TaskListPartitionConf numRead := partition["num_read_partitions"].(int) numWrite := partition["num_write_partitions"].(int) + // even if null is stored in cassandra, gocql will return empty struct instead of nil if version == 0 && numRead == 0 && numWrite == 0 { return nil } diff --git a/idls b/idls index 0ff09166fc7..b527eebaaea 160000 --- a/idls +++ b/idls @@ -1 +1 @@ -Subproject commit 0ff09166fc7c91176f23abba8ccbd280817ebc72 +Subproject commit b527eebaaeaa3cfbdc491f84040e5a27603222d8 From 10ff970fec5852174104ba603b275523e6199b72 Mon Sep 17 00:00:00 2001 From: Mantas Sidlauskas Date: Tue, 26 Nov 2024 08:13:48 +0200 Subject: [PATCH 4/4] merge master --- idls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idls b/idls index b527eebaaea..0ff09166fc7 160000 --- a/idls +++ b/idls @@ -1 +1 @@ -Subproject commit b527eebaaeaa3cfbdc491f84040e5a27603222d8 +Subproject commit 0ff09166fc7c91176f23abba8ccbd280817ebc72