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

Sylvain Lebresne commented on CASSANDRA-4584:
---------------------------------------------

I'm playing devil's advocate here but I wonder if this isn't something that 
would be better done at the protocol level. Typically there is two less that 
ideal thing if we make it part of the language?
* it's unclear what to do when we prepare a query with a TRACE in it. The 
current patch chose to trace both the preparation and all following execution. 
But that's 1) largely random and 2) not very flexible. As a user, I want to be 
able to trace an execution of a prepared query without having to trace 
everyone. And while maybe slightly less useful, being able to trace a prepare 
without necessary having all execution being traced would be neat too.
* as remarked by David, it means tracing the parsing of the query become less 
natural (to be honest that's not really a big deal, this would still be fairly 
to do, but suggests imho that trace don't belong to the language).

None of this is a problem if tracing is a protocol option. Besides, the 
protocol is already involved in the tracing in the sense that the trace ID 
cannot be returned in the ResultSet, so the protocol has to be involved already 
(and I note that for CQL over thrift, we already have the trace_next_query for 
that; adding it to the binary protocol will require a bit more work because of 
the asynchronous nature of the protocol, but we can leave that to later).

Last minor point in favor of not putting that in the language, we won't have to 
torture the parser to disallow writing slightly non-sensical queries like:
{noformat}
TRACE TRACE TRACE TRACE TRACE TRACE INSERT ....;
{noformat}
or
{noformat}
BEGIN BATCH INSERT ...; TRACE INSERT ...; INSERT ...; TRACE INSERT ...; APPLY 
BATCH;
{noformat}
and similar variation, all of which are allowed by the current patch.
                
> Add CQL syntax to enable request tracing
> ----------------------------------------
>
>                 Key: CASSANDRA-4584
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4584
>             Project: Cassandra
>          Issue Type: Sub-task
>    Affects Versions: 1.2.0 beta 1
>            Reporter: Jonathan Ellis
>            Assignee: David Alves
>              Labels: cql3
>             Fix For: 1.2.0 beta 2
>
>         Attachments: 4584.patch, 4584.patch, 4584.patch, 4584.patch, 
> 4584.patch
>
>


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to