Reputation: 527
I am trying to create index on 'conversations' keys with CREATE INDEX ON chat.user_conversation (keys(conversations))
but I am facing with the error
ServerError: java.lang.RuntimeException: java.util.concurrent.ExecutionException: org.apache.cassandra.exceptions.ConfigurationException: Column family ID mismatch (found 6de73fd0-c3ec-11e8-b098-f58bd8d3766a; expected 6c971920-c3ec-11e8-b098-f58bd8d3766a)
I tried to flush the table with nodetool flush
command and recreated table but the result hasn't changed.
This my table:
CREATE TABLE chat.user_conversation (
username text,
created_at timestamp,
conversations map<text, uuid>,
last_activity timestamp,
PRIMARY KEY (username, created_at)
) WITH CLUSTERING ORDER BY (created_at DESC)
AND bloom_filter_fp_chance = 0.01
AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
AND comment = ''
AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold': '32', 'min_threshold': '4'}
AND compression = {'chunk_length_in_kb': '64', 'class': 'org.apache.cassandra.io.compress.LZ4Compressor'}
AND crc_check_chance = 1.0
AND dclocal_read_repair_chance = 0.1
AND default_time_to_live = 0
AND gc_grace_seconds = 864000
AND max_index_interval = 2048
AND memtable_flush_period_in_ms = 0
AND min_index_interval = 128
AND read_repair_chance = 0.0
AND speculative_retry = '99PERCENTILE';
I also tried to creating for other fields but faced with the same error.
Using Cassandra 3.11.3
Upvotes: 2
Views: 397
Reputation: 527
For the future comers, the problem was using different versions of cassandra. I had tried ScyllaDB on the same docker machine. ScyllaDB was using Cassandra v3.0.8 and I had created same tables on it. After installing Cassandra on the same docker instance I faced with this error. Both scylladb and cassandra docker images use the same volume path.
Upvotes: 2
Reputation: 4426
This error means you've somehow created the same table with two different IDs - likely because you created the table programatically and they raced. This is a known limitation, that's being addressed, but the short version is that you shouldn't programatically create tables if there's any chance it can race (don't let two app servers do it at the same time).
The recovery here is typically difficult. If it's a new table, you probably want to just remove it and try again (and there's a good chance you're going to have a hard time reading it anyway). If it's got data you care about, you need to get all the CFIDs matching, which isn't super easy to achieve, and varies based on your cassandra version (you may need to rename directories and manually modify the schema tables - it's delicate and error prone).
Upvotes: 2