Adam Dyga
Adam Dyga

Reputation: 8896

Column family ID mismatch during ALTER TABLE

When adding a column to a table using cqlsh, I get the following error message:

ALTER TABLE table ADD dataVersion text;

ServerError: java.lang.RuntimeException: java.util.concurrent.ExecutionException: org.apache.cassandra.exceptions.ConfigurationException: Column family ID mismatch (found dbed2170-c53c-11e7-a6f8-6fd66506919d; expected db9404f0-c53c-11e7-8529-65b72ab1f7cf)

What does it really mean and what should I do with it? Is it a bug? The column seems to be added successfully.

Cassandra version is 3.0.14

Upvotes: 3

Views: 5533

Answers (2)

Toni Penya-Alba
Toni Penya-Alba

Reputation: 429

Flushing memtables (nodetool flush) did it for us.

Flushing does not require restarting cassandra whereas draining does.

Upvotes: 1

Pol Santamaria
Pol Santamaria

Reputation: 41

What does it really mean and what should I do with it?

When you make a schema change, it needs to be propagated. If you change the schema in different nodes before propagation you will end up with different schema versions (ID). Then this error will be raised.

Another situation happens if you make a schema change multiple times, even on the same node, before changes are applied this error will be raised too.

One solution is to restart Cassandra (drain, stop and start again). Avoid applying schema changes concurrently.

Is it a bug? The column seems to be added successfully.

Indeed, they are. But each node may have a different schema. Information on present schemas can be retrieved with nodetool describecluster.

Upvotes: 4

Related Questions