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

Benjamin Lerer commented on CASSANDRA-14879:
--------------------------------------------

[[email protected]] Thanks for working on this patch.  I looked at 
your patch and thought a bit more to the problem. I realized that my advise was 
in fact misleading sorry for that (it is the joy of the C* code base ;-) )

One thing which is tricky is that nothing prevent a user to first create a 
prepared statement and then to execute it later on. In this scenario, the 
current patch would log the statement at the wrong time. At parsing time, not 
at execution time. The QueryProcessor is a mess and need some serious love but 
basically we have 4 usecases:
# external query non prepared
# external query prepared
# internal query non prepared (query triggered by C*)
# internal query prepared (query triggered by C*)

As far as this patch is concerned, I would ignore the internal queries and 
focus only on external queries and put the logging in {{QueryMessage}} and 
{{ExecuteMessage}}.
I have added some comment to the PR too. :-) 

> Log DDL statements on coordinator
> ---------------------------------
>
>                 Key: CASSANDRA-14879
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-14879
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Legacy/CQL
>            Reporter: Sylvain Lebresne
>            Assignee: patrick lee
>            Priority: Low
>              Labels: AdventCalendar2021, lhf
>             Fix For: 4.x
>
>
> People sometimes run into issues with schema, and that is often because they 
> do concurrent schema changes, which are just not supported and we should fix 
> that someday, but in the meantime, it's not always easy to even check if you 
> may indeed have had concurrent schema changes.
> A very trivial way to make that easier would be to simply log DDL statements 
> on the coordinator before they are executed. This is likely useful info for 
> operators in the first place, and would allow in most case to track if 
> concurrent schema was the likely cause of a particular issue seen.
> +Additional info for newcomers:+
> In order to implement this change you will need to modify 
> {{org.apache.cassandra.cql3.QueryProcessor}} to log the schema change before 
> it is executed. 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to