Table schema collision fix
How to fix schema collision problems.
Dynamic schema creation or updates can cause schema collision resulting in errors.
Procedure
-
Run a rolling restart on all nodes to ensure schema matches. Run
nodetool describecluster
on all nodes. Check that there is only one schema version. -
On each node, check the
data
directory, looking for two directories for the table in question. If there is only one directory, go on to the next node. If there are two or more directories, the old table directory before update and a new table directory for after the update, continue. -
Identify which
cf_id
(column family ID) is the newest table ID insystem.schema_columnfamilies
. The column family ID is fifth column in the results.$ cqlsh -e "SELECT * FROM system.schema_column_families" |grep <tablename>
- Move the data from the older table to the newer table's directory and remove the old directory. Repeat this step as necessary.
-
Run
nodetool refresh
.