You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "David Capwell (Jira)" <ji...@apache.org> on 2021/05/19 21:13:00 UTC

[jira] [Comment Edited] (CASSANDRA-16581) Failure to execute queries should emit a KPI other than read timeout/unavailable so it can be alerted/tracked

    [ https://issues.apache.org/jira/browse/CASSANDRA-16581?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17347867#comment-17347867 ] 

David Capwell edited comment on CASSANDRA-16581 at 5/19/21, 9:12 PM:
---------------------------------------------------------------------

[~samt]

FrameEncoder change is

{code}
     public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception
     {
         if (!(msg instanceof Payload))
-            throw new IllegalStateException("Unexpected type: " + msg);
+        {
+            ctx.write(msg, promise);
+            return;
+        }
{code}

This isn't a leftover from debugging, its from the fact that we no longer support it as the v5 logic uses the more lower level APIs (such as ChannelInboundHandlerAdapter); the higher level APIs pass through objects which do not match the type.  Here is an example from v4 

{code}
public static class ProtocolEncoder extends MessageToMessageEncoder<Message>
{code}

MessageToMessageEncoder has the following https://github.com/netty/netty/blob/4.1/codec/src/main/java/io/netty/handler/codec/MessageToMessageEncoder.java#L84-L100

{code}
            if (acceptOutboundMessage(msg)) {
                ...
            } else {
                ctx.write(msg, promise);
            }
{code}

I use this in the simple client to send arbitrary payloads to validate server behavior.

ProtocolVersion - made the change



was (Author: dcapwell):
[~samt]

FrameEncoder change is

{code}
     public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception
     {
         if (!(msg instanceof Payload))
-            throw new IllegalStateException("Unexpected type: " + msg);
+        {
+            ctx.write(msg, promise);
+            return;
+        }
{code}

This isn't a leftover from debugging, its from the fact that we no longer support it as the v5 logic uses the more lower level APIs (such as ChannelInboundHandlerAdapter); the higher level APIs pass through objects which do not match the type.  Here is an example from v4 

{code}
public static class ProtocolEncoder extends MessageToMessageEncoder<Message>
{code}

MessageToMessageEncoder has the following https://github.com/netty/netty/blob/4.1/codec/src/main/java/io/netty/handler/codec/MessageToMessageEncoder.java#L84-L100

{code}
            if (acceptOutboundMessage(msg)) {
                ...
            } else {
                ctx.write(msg, promise);
            }
{code}

I use this in the simple client to send arbitrary payloads to validate server behavior.

ProtocolVersion - made the change; back porting now


> Failure to execute queries should emit a KPI other than read timeout/unavailable so it can be alerted/tracked
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-16581
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-16581
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Messaging/Client, Observability/Metrics
>            Reporter: David Capwell
>            Assignee: David Capwell
>            Priority: Normal
>             Fix For: 3.0.x, 3.11.x, 4.0-rc
>
>
> When we are unable to parse a message we do not have a way to detect this from a monitoring point of view so can get into situations where we believe the database is fine but the clients are on-fire.  This case popped up in the 2.1 to 3.0 upgrade as paging state wasn’t mixed-mode safe.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org