[ 
https://issues.apache.org/jira/browse/CASSANDRA-12835?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hannu Kröger updated CASSANDRA-12835:
-------------------------------------
    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:
{code:java}
            if (state.traceNextQuery())
            {
                state.createTracingSession();

                ImmutableMap.Builder<String, String> builder = 
ImmutableMap.builder();
{code}

{{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):
{code}
$ 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();
{code}

This is not marked as `minor` as the CASSANDRA-11706 was because this cannot be 
fixed by the tracing plugin.

  was:
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:
{code:java}
            if (state.traceNextQuery())
            {
                state.createTracingSession();

                ImmutableMap.Builder<String, String> builder = 
ImmutableMap.builder();
{code}

`state.createTracingSession();` should probably be 
`state.createTracingSession(getCustomPayload());`. At least that fixes the 
problem for me.

This is not marked as `minor` as the CASSANDRA-11706 was because this cannot be 
fixed by the tracing plugin.


> Tracing payload not passed from QueryMessage to tracing session
> ---------------------------------------------------------------
>
>                 Key: CASSANDRA-12835
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-12835
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Hannu Kröger
>            Priority: Critical
>              Labels: tracing
>
> 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:
> {code:java}
>             if (state.traceNextQuery())
>             {
>                 state.createTracingSession();
>                 ImmutableMap.Builder<String, String> builder = 
> ImmutableMap.builder();
> {code}
> {{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):
> {code}
> $ 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();
> {code}
> This is not marked as `minor` as the CASSANDRA-11706 was because this cannot 
> be fixed by the tracing plugin.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to