worryg0d commented on issue #1947:
URL:
https://github.com/apache/cassandra-gocql-driver/issues/1947#issuecomment-4371159237
I just did a bit of testing and identified that this is a regression
introduced in this commit 3c46f52a62e38098b6d49f82415cd730e0329ac3.
I can reproduce it locally with ccm: `ccm create -v 5.0.8 gocql_test3 -n
3:3`.
```go
func main() {
// CREATE KEYSPACE IF NOT EXISTS ks1 WITH replication = { 'class':
'NetworkTopologyStrategy', 'datacenter1': 3 };
// CREATE KEYSPACE IF NOT EXISTS ks2 WITH replication = { 'class':
'NetworkTopologyStrategy', 'datacenter1': 3, 'datacenter2': 3 };
const localDC = "dc1"
const remoteDC = "dc2"
cfg := gocql.NewCluster("127.0.0.4")
cfg.PoolConfig.HostSelectionPolicy =
gocql.TokenAwareHostPolicy(gocql.RoundRobinHostPolicy())
cfg.Timeout = 1 * time.Hour
cfg.ConnectTimeout = 1 * time.Hour
cfg.HostFilter = gocql.HostFilterFunc(func(host *gocql.HostInfo) bool {
return host.DataCenter() == remoteDC
})
session, err := cfg.CreateSession()
if err != nil {
panic(err)
}
defer session.Close()
metadata, err := session.KeyspaceMetadata("ks1")
if err != nil {
panic(err)
}
fmt.Println(toJSON(metadata))
}
func toJSON(data any) string {
json, err := json.Marshal(data)
if err != nil {
panic(err)
}
return string(json)
}
```
`networkTopology.replicaMap` method wasn't changed in that commit, so there
is something with the passed `tokenRing`. I didn't manage to identify it yet,
but I will try to figure out what is going on
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]