Skip to content

AxonOps — AI-Native Control Plane for Open Source Data Platforms

Cassandra Schema Disagreement

Schema disagreement occurs when nodes in a cluster have different versions of the schema. This can cause query failures, inconsistent behavior, and operational issues.


  • nodetool describecluster shows multiple schema versions
  • DDL operations fail or hang
  • Queries return inconsistent results
  • Errors mentioning "schema disagreement" in logs
  • New nodes fail to join cluster

Terminal window
nodetool describecluster

Expected output (healthy):

Schema versions:
<schema-uuid>: [node1, node2, node3]

Problem output:

Schema versions:
<schema-uuid-1>: [node1, node2]
<schema-uuid-2>: [node3]
UNREACHABLE: [node4]
Terminal window
# Check gossip info for schema version per node
nodetool gossipinfo | grep -E "SCHEMA|STATUS"
Terminal window
# Look for schema-related messages
grep -i "schema" /var/log/cassandra/system.log | tail -50
Terminal window
# Verify all nodes can communicate
for node in node1 node2 node3; do
nc -zv $node 7000 && echo "$node: OK" || echo "$node: FAILED"
done

Option 1: Wait for Convergence (Minor Disagreement)

Section titled “Option 1: Wait for Convergence (Minor Disagreement)”

Schema changes propagate via gossip. For recent changes, wait 30-60 seconds:

Terminal window
# Monitor schema convergence
watch -n 5 'nodetool describecluster | grep -A 20 "Schema versions"'

On each node with outdated schema:

Terminal window
# Reload schema from peers
nodetool reloadlocalschema

Option 3: Reset Local Schema (Single Node)

Section titled “Option 3: Reset Local Schema (Single Node)”

If one node has corrupted schema:

Terminal window
# Warning: This drops local schema and reloads from peers
nodetool resetlocalschema

Use with Caution

resetlocalschema should only be used on a single node that has diverged from the cluster. Never run on multiple nodes simultaneously.

If schema disagreement persists:

Terminal window
# On each node, one at a time:
nodetool drain
sudo systemctl restart cassandra
# Wait for node to rejoin before proceeding to next
nodetool status

Option 5: Force Schema Rebuild (Last Resort)

Section titled “Option 5: Force Schema Rebuild (Last Resort)”

If all else fails, use nodetool resetlocalschema on the problematic node:

Terminal window
# This drops local schema and reloads from cluster peers
nodetool resetlocalschema

Extreme Last Resort: Clear Schema Files

Only if the node cannot start and all other options fail:

Terminal window
# 1. Stop Cassandra
sudo systemctl stop cassandra
# 2. Remove local schema SSTables (forces reload from peers on restart)
sudo rm -rf /var/lib/cassandra/data/system_schema/*
# 3. Restart and let it rebuild from peers
sudo systemctl start cassandra

This should only be used when the node cannot start due to schema corruption.


Terminal window
# All nodes should show same schema version
nodetool describecluster
# Test DDL operations
cqlsh -e "CREATE KEYSPACE IF NOT EXISTS test_schema WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};"
cqlsh -e "DROP KEYSPACE test_schema;"
  1. Avoid concurrent DDL - Only run schema changes from one client
  2. Wait between DDL operations - Allow 10+ seconds between changes
  3. Monitor schema versions - Alert on disagreement
  4. Keep cluster healthy - Address node issues promptly

CausePrevention
Concurrent DDL from multiple clientsUse single schema management tool
Network partition during DDLEnsure network stability
Node crash during schema changeMonitor node health
Gossip issuesCheck firewall rules for port 7000
Clock skewSynchronize clocks with NTP (Clock Skew Failure Modes)

CommandPurpose
nodetool describeclusterView schema versions
nodetool gossipinfoCheck gossip state
nodetool reloadlocalschemaRefresh schema from peers
nodetool resetlocalschemaReset and reload schema