Richard Low created CASSANDRA-4866:
--------------------------------------
Summary: ConfigurationException when creating column families
simultaneously
Key: CASSANDRA-4866
URL: https://issues.apache.org/jira/browse/CASSANDRA-4866
Project: Cassandra
Issue Type: Bug
Components: Core
Affects Versions: 1.1.2
Reporter: Richard Low
This reproduces the problem:
Suppose there are just two nodes A and B.
* Create two client threads with separate connections.
* Connect them to A and they both create the same column family foo.
* One gets ID 1000, the other ID 1001.
* On the mutation stage, A processes the two CF creations, and asynchronously
sends the creation messages to B.
* Suppose B gets 1001 first, it creates it.
* A creates 1000
* B tries to create 1000 and fails (which is OK, we only want one CF)
* A tries to create 1001 and fails (which is OK, we only want one CF)
* Errors in the log like 'ConfigurationException: Column family ID mismatch
(found 1001; expected 1000)'
* Inserts, hints and repair now fails because the IDs are not consistent across
the cluster. Inserts fail with
'org.apache.cassandra.db.UnknownColumnFamilyException: Couldn't find cfId=1001'
There's a few problems here:
One is that DefsTable.mergeSchema applies the change, then calls
mergeColumnFamilies which could throw ConfigurationException. If
ConfigurationException is thrown, the local schema is in an invalid state. The
fix for this is to merge before updating the schema system CF.
The other issue is that there are two unique identifiers for the CF - the name
and the ID. It would be better to have just one to avoid this. And I think
the only safe way of doing this is to use the CF name, since the IDs could be
assigned in different orders.
Have I misunderstood how the concurrent schema updates work, or is simultaneous
CF creation not supported?
--
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