Column family ID mismatch during ALTER TABLE

爱⌒轻易说出口 提交于 2020-01-04 01:55:08

问题


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


回答1:


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.

  • How to drain a cassandra node: https://docs.datastax.com/en/cassandra/3.0/cassandra/tools/toolsDrain.html

  • Usage of describecluster: https://docs.datastax.com/en/cassandra/3.0/cassandra/tools/toolsDescribeCluster.html




回答2:


Flushing memtables (nodetool flush) did it for us.

Flushing does not require restarting cassandra whereas draining does.



来源:https://stackoverflow.com/questions/47928585/column-family-id-mismatch-during-alter-table

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!