Fixing a table schema collision

How to fix schema collision problems.

Dynamic schema creation or updates can cause a schema collision that results in errors.


  1. Run a rolling restart on all nodes to ensure the schema matches. Run nodetool describecluster on all nodes. Ensure that there is only one schema version.
    Tip: Perform a rolling restart using OpsCenter Monitoring.
  2. On each node, examine the data directory for the table to fix. The default location for the data directory is /var/lib/cassandra/data. If there is only one directory for the table, go to the next node and repeat this step. If there are two or more directories for the table, continue to the next step.
    Note: If there are two directories, the older directory contains the old table data before the update. The newer directory contains the new data after the update.
  3. Identify which id is the newest table ID in system_schema.tables using CQL.
    SELECT id, keyspace_name, table_name
    FROM system_schema.tables 
    WHERE keyspace_name = 'cycling'
      AND table_name = 'cyclist_name';
     id                                   | keyspace_name | table_name
     c2784ad1-065d-11ea-bd8d-9f9b8a53b5f5 |       cycling | cyclist_name
    (1 rows)
  4. Move the data from the older table to the newer table's directory, and then remove the older directory. Repeat this step as needed.
  5. Run nodetool refresh.