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

David Capwell commented on CASSANDRA-16114:
-------------------------------------------

looking at the code I see the following

{code}
Assert.assertTrue(lastSchemaChangeResult instanceof ResultMessage.SchemaChange);
ResultMessage.SchemaChange schemaChange = (ResultMessage.SchemaChange) 
lastSchemaChangeResult; // fails with java.lang.ClassCastException here
{code}

This implies concurrent modification, so looked for anything that creates 
modifications async and found org.apache.cassandra.cql3.CQLTester#afterTest 
does, so this would make this logic not thread safe (no memory barriers to make 
sure visible), and would make all tests that check this state unsafe as it can 
change after the test changes the schema.

> Fix tests CQLTester.assertLastSchemaChange causes ClassCastException
> --------------------------------------------------------------------
>
>                 Key: CASSANDRA-16114
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-16114
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Test/unit
>            Reporter: David Capwell
>            Priority: Normal
>             Fix For: 4.0-beta
>
>
> Build: 
> https://app.circleci.com/pipelines/github/dcapwell/cassandra/494/workflows/b3765545-7b09-48dd-85ff-830c4f348329/jobs/2681
> {code}
> java.lang.ClassCastException: 
> org.apache.cassandra.transport.messages.ResultMessage$Void cannot be cast to 
> org.apache.cassandra.transport.messages.ResultMessage$SchemaChange
>       at 
> org.apache.cassandra.cql3.CQLTester.assertLastSchemaChange(CQLTester.java:916)
>       at 
> org.apache.cassandra.cql3.validation.entities.UFTest.testSchemaChange(UFTest.java:94)
> {code}



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

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

Reply via email to