[
https://issues.apache.org/jira/browse/CASSANDRA-10776?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Sylvain Lebresne resolved CASSANDRA-10776.
------------------------------------------
Resolution: Duplicate
Unfortunately, the problem is that creating the same table concurrently is just
not supported by Cassandra (and has never been) and you should not do it (or
you'll run in that issue). Again, this is unfortunate but fixing it is pretty
much CASSANDRA-10699, and that's not a small endeavor.
The {{IF NOT EXISTS}} for DDL is actually not useful to prevent concurrent
creation, it's only a convenience when you know the table may pre-exist, which
is mostly useful for testing purposes to be honest.
Again, let me clarify that I'm not saying this is a desirable thing and not
something we should fix, and in fact we have ticket to fix it, CASSANDRA-10699,
but to be honest it's unlikely to be addressed within a short time frame.
> 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)