[
https://issues.apache.org/jira/browse/CASSANDRA-14366?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18100722#comment-18100722
]
Stefan Miklosovic edited comment on CASSANDRA-14366 at 7/31/26 11:50 AM:
-------------------------------------------------------------------------
Well, first of all that test is failing.
Secondly, I suggested to change the column name in the PR to "Prepared
Statement Cache" from "Prepared Stmt Cache". Arvind did it, but then we have
the output like this:
{code:java}
$ ./bin/nodetool info
ID : 6d194555-f6eb-41d0-c000-000000000001
...
Counter Cache : entries 0, size 0 bytes, capacity 23 MiB, 0 hits, 0
requests, NaN recent hit rate, 7200 save period in seconds
Prepared Statement Cache: entries 0, size 0 bytes, capacity 10 MiB, 0
executions, 0 evictions
Percent Repaired : 100.0%
.... {code}
That is because we are manually crafting the number of characters the first
column occupies, currently to 23, and it started to "overflow".
nodetool info (Info class) does not use TableBuilder which automatically adjust
the output like this which is quite unfortunate.
I was rewriting it to TableBuilder but then I realized that it is not so simple
... the "problem" with TableBuilder is that it pads the output of every line
with spaces, up to the number of characters the longest line has. While this
looks visually the same as previous way, these invisible spaces can break the
custom parsing if it is tailored for the old way of doing it where all lines
are as long as the actual line is, instead of padding it with spaces.
For other commands this kind of change would be OK but I feel like {{nodetool
info}} might be so frequently parsed that we would break people's regexp-es.
This is one of the mostly executed nodetool command (together with status etc).
Hence the best course of action is to go back to "Prepared Stmt Cache" just to
fit it in.
The changes are here:
[https://github.com/apache/cassandra/compare/trunk...smiklosovic:cassandra:CASSANDRA-14366?expand=1]
I will take care of the rest (build, merge etc) after this release train we go
through is done.
multiplex:
[https://app.circleci.com/pipelines/github/instaclustr/cassandra/6635/workflows/3748b55c-94c2-4eee-8a7d-4f8f7f060103]
was (Author: smiklosovic):
Well, first of all that test is failing.
Secondly, I suggested to change the column name in the PR to "Prepared
Statement Cache" from "Prepared Stmt Cache". Arvind did it, but then we have
the output like this:
{code:java}
$ ./bin/nodetool info
ID : 6d194555-f6eb-41d0-c000-000000000001
...
Counter Cache : entries 0, size 0 bytes, capacity 23 MiB, 0 hits, 0
requests, NaN recent hit rate, 7200 save period in seconds
Prepared Statement Cache: entries 0, size 0 bytes, capacity 10 MiB, 0
executions, 0 evictions
Percent Repaired : 100.0%
.... {code}
That is because we are manually crafting the number of characters the first
column occupies, currently to 23, and it started to "overflow".
nodetool info (Info class) does not use TableBuilder which automatically adjust
the output like this which is quite unfortunate.
multiplex:
https://app.circleci.com/pipelines/github/instaclustr/cassandra/6635/workflows/3748b55c-94c2-4eee-8a7d-4f8f7f060103
I was rewriting it to TableBuilder but then I realized that it is not so simple
... the "problem" with TableBuilder is that it pads the output of every line
with spaces, up to the number of characters the longest line has. While this
looks visually the same as previous way, these invisible spaces can break the
custom parsing if it is tailored for the old way of doing it where all lines
are as long as the actual line is, instead of padding it with spaces.
For other commands this kind of change would be OK but I feel like {{nodetool
info}} might be so frequently parsed that we would break people's regexp-es.
This is one of the mostly executed nodetool command (together with status etc).
Hence the best course of action is to go back to "Prepared Stmt Cache" just to
fit it in.
The changes are here:
[https://github.com/apache/cassandra/compare/trunk...smiklosovic:cassandra:CASSANDRA-14366?expand=1]
I will take care of the rest (build, merge etc) after this release train we go
through is done.
> Add prepared statement cache stats to nodetool info
> ---------------------------------------------------
>
> Key: CASSANDRA-14366
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14366
> Project: Apache Cassandra
> Issue Type: Improvement
> Components: Observability/Metrics, Tool/nodetool
> Reporter: Jon Haddad
> Assignee: Arvind Kandpal
> Priority: Normal
> Fix For: 7.x
>
> Time Spent: 1h
> Remaining Estimate: 0h
>
> We expose some cache stats in {{nodetool info}}, let's add prepared statement
> cache stats.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]