[
https://issues.apache.org/jira/browse/CASSANDRA-19388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17825844#comment-17825844
]
Jane He commented on CASSANDRA-19388:
-------------------------------------
Hey, I want to confirm:
When a session just starts, I see the following metrics.
{code:java}
# HELP s0_connected_nodes
# TYPE s0_connected_nodes gauge
s0_connected_nodes 3.0
# HELP s0_bytes_sent_total
# TYPE s0_bytes_sent_total counter
s0_bytes_sent_total 3604.0{code}
After I close and reinit the session, this is what I see from Prometheus
{code:java}
# HELP s1_bytes_sent_total
# TYPE s1_bytes_sent_total counter
s1_bytes_sent_total 2334.0
# HELP s1_connected_nodes
# TYPE s1_connected_nodes gauge
s1_connected_nodes 3.0
# HELP s0_connected_nodes
# TYPE s0_connected_nodes gauge
s0_connected_nodes 1.0
# HELP s0_bytes_sent_total
# TYPE s0_bytes_sent_total counter
s0_bytes_sent_total 3604.0{code}
s0 shows 1 connected_nodes, and the new session s1 shows 3 connected nodes. In
both cases, the metadata live nodes count is 3.
{code:java}
int count = 0;
for (Node node : runner.getCurrentSession().getMetadata().getNodes().values()) {
if (node.getOpenConnections() > 0) {
count++;
}
} {code}
Do you mean:
1. `s0` should be 0, but you see 1?
2. You see `s1`'s connected_nodes becomes 1?
3. You see other results?
> Incorrect connected node metric when session is closed and reinitted in same
> JVM
> --------------------------------------------------------------------------------
>
> Key: CASSANDRA-19388
> URL: https://issues.apache.org/jira/browse/CASSANDRA-19388
> Project: Cassandra
> Issue Type: Bug
> Components: Client/java-driver
> Reporter: Nitin Chhabra
> Assignee: Henry Hughes
> Priority: Normal
>
> We observed incorrect connected nodes metric reported when session is closed
> and re-initted.
> *Setup*
> Java 8
> Java Driver Version: 4.15.0
> Cassandra Server: 4.X
> 3 nodes in Azure West
>
> *Steps to reproduce the issue*
> # Init the CQLSession successfully.
> # Observe the connected nodes metric is 3.
> # Stop the session gracefully by calling: session.closeAsync() and wait for
> few seconds for close.
> # _Reinit the CQLSession and monitor the connected nodes metric. It goes
> down to 1._
>
> *Triage/Troubleshooting*
> On Cassandra Server side, we can observe connections made to all 3 nodes.
> Upon further debugging by putting some log statements and modifying the
> driver, it appears the NodeStateManager updates its open connection count to
> 3, however MetaDataManager does not show all 3 nodes have active connections.
> Please let me know if more info is needed.
>
> Also, had initiated similar discussion in Open Src Community:
> [https://groups.google.com/a/lists.datastax.com/g/java-driver-user/c/VoPOha4Oc0c/m/IDCVAREMAgAJ?utm_medium=email&utm_source=footer|https://urldefense.com/v3/__https://groups.google.com/a/lists.datastax.com/g/java-driver-user/c/VoPOha4Oc0c/m/IDCVAREMAgAJ?utm_medium=email&utm_source=footer__;!!IfjTnhH9!XpuIqw-OxNBAy2e4AVXzpwJwHST0C5CevI9NQGMGp54QUFPJGFCt5PZF527PRMYABto_Dwk03Pwb1dNSEgcLatnsOQ$].
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]