[jira] [Commented] (CASSANDRA-10776) Prepare of statements after table creation fail with unconfigured column family

2016-03-01 Thread Jan Karlsson (JIRA)

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

Jan Karlsson commented on CASSANDRA-10776:
--

This can actually be solved by having a lock table, which you check with before 
creating a table. Use LWT to check whether the lock exists and if it does not, 
gain the lock and create the table.

> Prepare of statements after table creation fail with unconfigured column 
> family
> ---
>
> Key: CASSANDRA-10776
> URL: https://issues.apache.org/jira/browse/CASSANDRA-10776
> Project: Cassandra
>  Issue Type: Bug
>Reporter: Adam Dougal
>
> Cassandra 2.1.8
> We have multiple app instances trying to create the same table using IF NOT 
> EXISTS.
> We check for schema agreement via the Java Driver before and after every 
> statement.
> After creating the table we then prepare statements and we sometimes get:
> {code}
> com.datastax.driver.core.exceptions.InvalidQueryException: unconfigured 
> columnfamily locks
>   at 
> com.datastax.driver.core.exceptions.InvalidQueryException.copy(InvalidQueryException.java:50)
>  ~[cassandra-driver-core-2.1.8.jar:na]
>   at 
> com.datastax.driver.core.DriverThrowables.propagateCause(DriverThrowables.java:37)
>  ~[cassandra-driver-core-2.1.8.jar:na]
>   at 
> com.datastax.driver.core.AbstractSession.prepare(AbstractSession.java:79) 
> ~[cassandra-driver-core-2.1.8.jar:na]
>   at 
> uk.sky.cirrus.locking.CassandraLockingMechanism.init(CassandraLockingMechanism.java:69)
>  ~[main/:na]
>   at uk.sky.cirrus.locking.Lock.acquire(Lock.java:35) [main/:na]
>   at uk.sky.cirrus.CqlMigratorImpl.migrate(CqlMigratorImpl.java:83) 
> [main/:na]
>   at 
> uk.sky.cirrus.locking.LockVerificationTest.lambda$shouldManageContentionsForSchemaMigrate$0(LockVerificationTest.java:90)
>  [test/:na]
>   at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
> ~[na:1.8.0_60]
>   at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>  ~[na:1.8.0_60]
>   at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>  ~[na:1.8.0_60]
>   at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_60]
> {code}
> Looking at the server logs we get:
> {code}
> ava.lang.RuntimeException: 
> org.apache.cassandra.exceptions.ConfigurationException: Column family ID 
> mismatch (found 90bbb372-9446-11e5-b1ca-8119a6964819; expected 
> 90b87f20-9446-11e5-b1ca-8119a6964819)
>   at org.apache.cassandra.config.CFMetaData.reload(CFMetaData.java:1145) 
> ~[main/:na]
>   at 
> org.apache.cassandra.db.DefsTables.updateColumnFamily(DefsTables.java:422) 
> ~[main/:na]
>   at 
> org.apache.cassandra.db.DefsTables.mergeColumnFamilies(DefsTables.java:295) 
> ~[main/:na]
>   at 
> org.apache.cassandra.db.DefsTables.mergeSchemaInternal(DefsTables.java:194) 
> ~[main/:na]
>   at org.apache.cassandra.db.DefsTables.mergeSchema(DefsTables.java:166) 
> ~[main/:na]
>   at 
> org.apache.cassandra.db.DefinitionsUpdateVerbHandler$1.runMayThrow(DefinitionsUpdateVerbHandler.java:49)
>  ~[main/:na]
>   at 
> org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:28) 
> ~[main/:na]
>   at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
> ~[na:1.8.0_60]
>   at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
> ~[na:1.8.0_60]
>   at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>  ~[na:1.8.0_60]
>   at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>  [na:1.8.0_60]
>   at java.lang.Thread.run(Thread.java:745) [na:1.8.0_60]
> {code}
> We found this issue which is marked as resolved:
> https://issues.apache.org/jira/browse/CASSANDRA-8387
> Does the IF NOT EXISTS just check the local node?



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


[jira] [Commented] (CASSANDRA-10776) Prepare of statements after table creation fail with unconfigured column family

2015-11-26 Thread Adam Dougal (JIRA)

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

Adam Dougal commented on CASSANDRA-10776:
-

To check if IF NOT EXISTS checks only one node or not we tried running this 
against a single node cluster. This caused the column family id mismatch error 
to be thrown by the driver as well as being shown in the server logs.

{code}
com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried 
for query failed (tried: localhost/127.0.0.1:9042 
(com.datastax.driver.core.exceptions.DriverException: Host replied with server 
error: java.lang.RuntimeException: java.util.concurrent.ExecutionException: 
java.lang.RuntimeException: 
org.apache.cassandra.exceptions.ConfigurationException: Column family ID 
mismatch (found 672ae1b0-9456-11e5-b539-8119a6964819; expected 
672a6c80-9456-11e5-b539-8119a6964819)))
at 
com.datastax.driver.core.exceptions.NoHostAvailableException.copy(NoHostAvailableException.java:84)
 ~[cassandra-driver-core-2.1.8.jar:na]
at 
com.datastax.driver.core.DriverThrowables.propagateCause(DriverThrowables.java:37)
 ~[cassandra-driver-core-2.1.8.jar:na]
at 
com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly(DefaultResultSetFuture.java:214)
 ~[cassandra-driver-core-2.1.8.jar:na]
at 
com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:52) 
~[cassandra-driver-core-2.1.8.jar:na]
at 
com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:36) 
~[cassandra-driver-core-2.1.8.jar:na]
at 
uk.sky.cirrus.locking.CassandraLockingMechanism.init(CassandraLockingMechanism.java:72)
 ~[main/:na]
at uk.sky.cirrus.locking.Lock.acquire(Lock.java:35) [main/:na]
at uk.sky.cirrus.CqlMigratorImpl.migrate(CqlMigratorImpl.java:83) 
[main/:na]
at 
uk.sky.cirrus.locking.LockVerificationTest.lambda$shouldManageContentionsForSchemaMigrate$0(LockVerificationTest.java:90)
 [test/:na]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
~[na:1.8.0_60]
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
~[na:1.8.0_60]
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
~[na:1.8.0_60]
at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_60]
Caused by: com.datastax.driver.core.exceptions.NoHostAvailableException: All 
host(s) tried for query failed (tried: localhost/127.0.0.1:9042 
(com.datastax.driver.core.exceptions.DriverException: Host replied with server 
error: java.lang.RuntimeException: java.util.concurrent.ExecutionException: 
java.lang.RuntimeException: 
org.apache.cassandra.exceptions.ConfigurationException: Column family ID 
mismatch (found 672ae1b0-9456-11e5-b539-8119a6964819; expected 
672a6c80-9456-11e5-b539-8119a6964819)))
at 
com.datastax.driver.core.RequestHandler.reportNoMoreHosts(RequestHandler.java:217)
 ~[cassandra-driver-core-2.1.8.jar:na]
at 
com.datastax.driver.core.RequestHandler.access$1000(RequestHandler.java:44) 
~[cassandra-driver-core-2.1.8.jar:na]
at 
com.datastax.driver.core.RequestHandler$SpeculativeExecution.sendRequest(RequestHandler.java:276)
 ~[cassandra-driver-core-2.1.8.jar:na]
at 
com.datastax.driver.core.RequestHandler$SpeculativeExecution$1.run(RequestHandler.java:374)
 ~[cassandra-driver-core-2.1.8.jar:na]
... 3 common frames omitted
{code}

> Prepare of statements after table creation fail with unconfigured column 
> family
> ---
>
> Key: CASSANDRA-10776
> URL: https://issues.apache.org/jira/browse/CASSANDRA-10776
> Project: Cassandra
>  Issue Type: Bug
>Reporter: Adam Dougal
>
> Cassandra 2.1.8
> We have multiple app instances trying to create the same table using IF NOT 
> EXISTS.
> We check for schema agreement via the Java Driver before and after every 
> statement.
> After creating the table we then prepare statements and we sometimes get:
> {code}
> com.datastax.driver.core.exceptions.InvalidQueryException: unconfigured 
> columnfamily locks
>   at 
> com.datastax.driver.core.exceptions.InvalidQueryException.copy(InvalidQueryException.java:50)
>  ~[cassandra-driver-core-2.1.8.jar:na]
>   at 
> com.datastax.driver.core.DriverThrowables.propagateCause(DriverThrowables.java:37)
>  ~[cassandra-driver-core-2.1.8.jar:na]
>   at 
> com.datastax.driver.core.AbstractSession.prepare(AbstractSession.java:79) 
> ~[cassandra-driver-core-2.1.8.jar:na]
>   at 
> uk.sky.cirrus.locking.CassandraLockingMechanism.init(CassandraLockingMechanism.java:69)
>  ~[main/:na]
>   at uk.sky.cirrus.locking.Lock.acquire(Lock.java:35) [main/:na]
>   at uk.sky.cirrus.CqlMigratorImpl.migrate(CqlMigratorImpl.java: