- 
                Notifications
    
You must be signed in to change notification settings  - Fork 41.6k
 
Description
The current CassandraHealthIndicator is examining the health of the underlying cluster by executing simple SELECT .release_version FROM system.local with consistency level set to ONE.
It serves the purpose of the very simple health indicator, but it may be unreliable in the cluster of more nodes. Assuming that we have N nodes cluster, the current health check will return UP if at least ONE node is up and running. In the worst-case situation, all N - 1 nodes may be down, but the health-check will still report the status as UP.
The CqlSession is keeping the state of the cluster at the client-side and is available via the getMetadata() method.
I am proposing improving the CassandraHealthIndicator to report status based on the status of all nodes in the cluster.
Additionally, the indicator can report useful status info per node such as distance , open_connections, version, etc
The improved algorithm would be very similar to https://github.com/micronaut-projects/micronaut-cassandra/pull/62/files#diff-d63dab53c3ed54a82678650761baaf5aR55-R104.