You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried getting the metadata of keyspace to check the table existence while gocql client is connected to cassandra. After I stopped the cassandra, gocql wasn't throwing any error and returning cached metadata to check the table existence.
Also, when I checked session.Closed it returns false when cassandra wasn't running.
What did you expect to see?
Error should have been thrown.
session.Closed should have returned true, when cassandra went down or stopped after client made a successful session.
What did you see instead?
session.Closed it returns false when cassandra wasn't running.
The text was updated successfully, but these errors were encountered:
Session.Closed() returns true only after you call Session.Close(). That is a feature, not a bug.
When the Cassandra server is not reachable, the session is still open and will reconnect automatically once the Cassandra server becomes available. We should update the documentation to describe what Close() does.
Individual queries or batches that you execute will return errors. If you want to check if the Cassandra cluster is available, you could execute a regular query.
The driver caches keyspace metadata because it would be expensive to load it on every query. Why is it a problem for you if the driver returns cached keyspace metadata?
v0.0.0-20200221113847-372a19b1a852
This version is two years old. Please use the latest version of the driver.
we are using gocql in a central health manager where other apps will call central health manager to check for the cassandra connectivity and the existence of tables those are required by the apps. So, if we get the cache data then there is a chance that app might start and cassandra is not running. Kind of hard dependency on cassandra.
So, now we are executing a query with limit 1 that is returning error whenever cassandra is not connected and fulfilling the purpose.
Reason behind using older version of gocql is that we are using old version of go 1.14
What version of Cassandra are you using?
3.11.3
What version of Gocql are you using?
v0.0.0-20200221113847-372a19b1a852
What version of Go are you using?
1.14
What did you do?
I tried getting the metadata of keyspace to check the table existence while gocql client is connected to cassandra. After I stopped the cassandra, gocql wasn't throwing any error and returning cached metadata to check the table existence.
Also, when I checked session.Closed it returns false when cassandra wasn't running.
What did you expect to see?
Error should have been thrown.
session.Closed should have returned true, when cassandra went down or stopped after client made a successful session.
What did you see instead?
session.Closed it returns false when cassandra wasn't running.
The text was updated successfully, but these errors were encountered: