Fix Client RequestsSize metric always reporting 0 for native protocol v5 connections - #5120
Open
amalsebs wants to merge 1 commit into
Open
Fix Client RequestsSize metric always reporting 0 for native protocol v5 connections#5120amalsebs wants to merge 1 commit into
amalsebs wants to merge 1 commit into
Conversation
… v5+ connections V5 connections only draw on the shared endpoint/global reserve once a connection's private queue budget is exceeded, so ordinary traffic never touches the counter this metric reads from. V4 always does, which is why only v5 was affected. patch by Amal Sebastian for CASSANDRA-21091
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
V5 only touches the shared reserve once a connection's local queue budget is exceeded, so normal traffic never hits the counter this metric reads. V4 always hits it, which is why the gauge worked there but not on v5.
Added hooks in AbstractMessageHandler so both paths report to the same counter regardless of whether the reserve was actually used, and pointed ClientMetrics at that instead. Didn't touch backpressure/admission control at all.
Added a test in CQLConnectionTest that reproduces this - reserve stays at 0 but the gauge still moves.
Ran transport/metrics/net/cql3 test packages + ant check locally on JDK 17, all green.
CASSANDRA-21091