Details
-
Bug
-
Status: Resolved
-
Urgent
-
Resolution: Fixed
-
None
-
Critical
Description
Caused by CASSANDRA-10392.
Related to CASSANDRA-11706.
When querying using CQL statements (not prepared) the message type is QueryMessage and the code in https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/transport/messages/QueryMessage.java#L101 is as follows:
if (state.traceNextQuery()) { state.createTracingSession(); ImmutableMap.Builder<String, String> builder = ImmutableMap.builder();
state.createTracingSession(); should probably be state.createTracingSession(getCustomPayload());. At least that fixes the problem for me.
This also raises the question whether some other parts of the code should pass the custom payload as well (I'm not the right person to analyze this):
$ ag createTracingSession src/java/org/apache/cassandra/service/QueryState.java 80: public void createTracingSession() 82: createTracingSession(Collections.EMPTY_MAP); 85: public void createTracingSession(Map<String,ByteBuffer> customPayload) src/java/org/apache/cassandra/thrift/CassandraServer.java 2528: state().getQueryState().createTracingSession(); src/java/org/apache/cassandra/transport/messages/BatchMessage.java 163: state.createTracingSession(); src/java/org/apache/cassandra/transport/messages/ExecuteMessage.java 114: state.createTracingSession(getCustomPayload()); src/java/org/apache/cassandra/transport/messages/QueryMessage.java 101: state.createTracingSession(); src/java/org/apache/cassandra/transport/messages/PrepareMessage.java 74: state.createTracingSession();
This is not marked as `minor` as the CASSANDRA-11706 was because this cannot be fixed by the tracing plugin.