You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "EvgeniiR (via GitHub)" <gi...@apache.org> on 2026/06/23 16:04:02 UTC
[PR] CASSANDRA-21117: Fix unreliable metric "networking cache size" in nodetool info [cassandra]
EvgeniiR opened a new pull request, #4898:
URL: https://github.com/apache/cassandra/pull/4898
nodetool info reported "Network Cache" size using BufferPool.sizeInBytes() which includes memoryAllocated - a monotonically non-decreasing counter that never drops below the pool's high-water mark. Switch to usedSizeInBytes() which tracks only currently checked-out buffers.
Additionally fix BufferPool.LocalPool.putUnusedPortion for non-pooled buffers: the chunk==null branch was decrementing overflowMemoryUsage by the unused portion, but the subsequent put() decremented by the full original capacity, causing overflowMemoryUsage to drift negative over time.
patch by EvgeniiR; reviewed by TBD for CASSANDRA-21117
The [Cassandra Jira](https://issues.apache.org/jira/projects/CASSANDRA/issues/)
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] CASSANDRA-21117: Fix unreliable metric "networking cache size" in nodetool info [cassandra]
Posted by "EvgeniiR (via GitHub)" <gi...@apache.org>.
EvgeniiR commented on PR #4898:
URL: https://github.com/apache/cassandra/pull/4898#issuecomment-4781292749
> @EvgeniiR can you resolve the conflict? Just nuke that change in changes.txt for now
Done.
Copilot suggested changing the output format. Do we actually want to change it here?
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] CASSANDRA-21117: Fix unreliable metric "networking cache size" in nodetool info [cassandra]
Posted by "EvgeniiR (via GitHub)" <gi...@apache.org>.
EvgeniiR commented on PR #4898:
URL: https://github.com/apache/cassandra/pull/4898#issuecomment-4781940877
Examples from local testing:
<details>
<summary>Info output with fix applied</summary>
```sh
bin/nodetool info
ID : 6d194555-f6eb-41d0-c000-000000000001
Gossip active : true
Native Transport active: true
Load : 123.67 KiB
Uncompressed load : 174.96 KiB
Generation No : 1782235131
Uptime (seconds) : 426
Heap Memory (MB) : 7661.99 / 15904.00
Off Heap Memory (MB) : 0.00
Data Center : datacenter1
Rack : rack1
Exceptions : 0
Key Cache : entries 25, size 1.99 KiB, capacity 100 MiB, 1109 hits, 1131 requests, 0.981 recent hit rate, 14400 save period in seconds
Row Cache : entries 0, size 0 bytes, capacity 0 bytes, 0 hits, 0 requests, NaN recent hit rate, 0 save period in seconds
Counter Cache : entries 0, size 0 bytes, capacity 50 MiB, 0 hits, 0 requests, NaN recent hit rate, 7200 save period in seconds
**Network Cache : size 8.09 KiB**, overflow size: 0 bytes, capacity 128 MiB
Percent Repaired : 100.0%
Token : (invoke with -T/--tokens to see all 16 tokens)
Bootstrap state : COMPLETED
Bootstrap failed : false
Decommissioning : false
Decommission failed : false
```
</details>
- ```Network Cache size``` value now increases and decreases accordingly
<details>
<summary>Info output on trunk</summary>
```sh
bin/nodetool info
ID : 6d194555-f6eb-41d0-c000-000000000001
Gossip active : true
Native Transport active: true
Load : 230.47 MiB
Uncompressed load : 230.55 MiB
Generation No : 1782235801
Uptime (seconds) : 405
Heap Memory (MB) : 5359.93 / 15904.00
Off Heap Memory (MB) : 1.33
Data Center : datacenter1
Rack : rack1
Exceptions : 0
Key Cache : entries 11, size 904 bytes, capacity 100 MiB, 149 hits, 160 requests, 0.931 recent hit rate, 14400 save period in seconds
Row Cache : entries 0, size 0 bytes, capacity 0 bytes, 0 hits, 0 requests, NaN recent hit rate, 0 save period in seconds
Counter Cache : entries 0, size 0 bytes, capacity 50 MiB, 0 hits, 0 requests, NaN recent hit rate, 7200 save period in seconds
Network Cache : size 8 MiB, overflow size: 0 bytes, capacity 128 MiB
Percent Repaired : 100.0%
Token : (invoke with -T/--tokens to see all 16 tokens)
Bootstrap state : COMPLETED
Bootstrap failed : false
Decommissioning : false
Decommission failed : false
```
</details>
- ```Network Cache size``` jumped to 8MiB on the first request and does not decrease afterwards
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] CASSANDRA-21117: Fix unreliable metric "networking cache size" in nodetool info [cassandra]
Posted by "EvgeniiR (via GitHub)" <gi...@apache.org>.
EvgeniiR commented on PR #4898:
URL: https://github.com/apache/cassandra/pull/4898#issuecomment-4781526590
> @EvgeniiR where? You havent pushed or it is same as it was.
My bad, sorry. Latest changed pushed now. Output value is updated, tool output kept the same format.
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] CASSANDRA-21117: Fix unreliable metric "networking cache size" in nodetool info [cassandra]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #4898:
URL: https://github.com/apache/cassandra/pull/4898#discussion_r3461267636
##########
src/java/org/apache/cassandra/tools/nodetool/Info.java:
##########
@@ -144,8 +144,8 @@ public void execute(NodeProbe probe)
// network Cache: capacity, size
try
{
- out.printf("%-23s: size %s, overflow size: %s, capacity %s%n", "Network Cache",
- FileUtils.stringifyFileSize((long) probe.getBufferPoolMetric("networking", "Size")),
+ out.printf("%-23s: size in use %s, overflow size: %s, capacity %s%n", "Network Cache",
+ FileUtils.stringifyFileSize((long) probe.getBufferPoolMetric("networking", "UsedSize")),
FileUtils.stringifyFileSize((long) probe.getBufferPoolMetric("networking", "OverflowSize")),
FileUtils.stringifyFileSize((long) probe.getBufferPoolMetric("networking", "Capacity")));
Review Comment:
The nodetool info output string changed from "size …" to "size in use …" while also switching the underlying metric from `Size` to `UsedSize`. Changing the human-readable output can break scripts that parse nodetool output; you can keep the existing output format and still fix the metric by only changing the metric name. Also update the nearby comment so it no longer refers to the old metric semantics.
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] CASSANDRA-21117: Fix unreliable metric "networking cache size" in nodetool info [cassandra]
Posted by "smiklosovic (via GitHub)" <gi...@apache.org>.
smiklosovic commented on PR #4898:
URL: https://github.com/apache/cassandra/pull/4898#issuecomment-4781896847
cc @netudima
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] CASSANDRA-21117: Fix unreliable metric "networking cache size" in nodetool info [cassandra]
Posted by "smiklosovic (via GitHub)" <gi...@apache.org>.
smiklosovic commented on PR #4898:
URL: https://github.com/apache/cassandra/pull/4898#issuecomment-4781456932
@EvgeniiR where? You havent pushed or it is same as it was.
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] CASSANDRA-21117: Fix unreliable metric "networking cache size" in nodetool info [cassandra]
Posted by "smiklosovic (via GitHub)" <gi...@apache.org>.
smiklosovic commented on PR #4898:
URL: https://github.com/apache/cassandra/pull/4898#issuecomment-4781200716
@EvgeniiR can you resolve the conflict? Just nuke that change in changes.txt for now
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] CASSANDRA-21117: Fix unreliable metric "networking cache size" in nodetool info [cassandra]
Posted by "smiklosovic (via GitHub)" <gi...@apache.org>.
smiklosovic commented on code in PR #4898:
URL: https://github.com/apache/cassandra/pull/4898#discussion_r3461431609
##########
src/java/org/apache/cassandra/tools/nodetool/Info.java:
##########
@@ -144,8 +144,8 @@ public void execute(NodeProbe probe)
// network Cache: capacity, size
try
{
- out.printf("%-23s: size %s, overflow size: %s, capacity %s%n", "Network Cache",
- FileUtils.stringifyFileSize((long) probe.getBufferPoolMetric("networking", "Size")),
+ out.printf("%-23s: size in use %s, overflow size: %s, capacity %s%n", "Network Cache",
+ FileUtils.stringifyFileSize((long) probe.getBufferPoolMetric("networking", "UsedSize")),
FileUtils.stringifyFileSize((long) probe.getBufferPoolMetric("networking", "OverflowSize")),
FileUtils.stringifyFileSize((long) probe.getBufferPoolMetric("networking", "Capacity")));
Review Comment:
@EvgeniiR this is still not changed
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org