apache/cassandra · warning
Failed to get schema to converge before building view {}.{}
Error message
Failed to get schema to converge before building view {}.{} What it means
ViewBuilderTask.call() waits for schema agreement (up to 10 seconds) before building a view, because view building may start before the MV creation has propagated to every node — building too early would cause UnknownTableException when replicas deserialize view mutations. If agreement is not reached in time it logs this warning and proceeds anyway, which usually still works but risks failures on nodes lacking the schema.
Source
Thrown at src/java/org/apache/cassandra/db/view/ViewBuilderTask.java:138
}
public Long call()
{
String ksName = baseCfs.metadata.keyspace;
if (prevToken == null)
logger.debug("Starting new view build for range {}", range);
else
logger.debug("Resuming view build for range {} from token {} with {} covered keys", range, prevToken, keysBuilt);
/*
* It's possible for view building to start before MV creation got propagated to other nodes. For this reason
* we should wait for schema to converge before attempting to send any view mutations to other nodes, or else
* face UnknownTableException upon Mutation deserialization on the nodes that haven't processed the schema change.
*/
boolean schemaConverged = Gossiper.instance.waitForSchemaAgreement(10, TimeUnit.SECONDS, () -> this.isStopped);
if (!schemaConverged)
logger.warn("Failed to get schema to converge before building view {}.{}", baseCfs.getKeyspaceName(), view.name);
Function<org.apache.cassandra.db.lifecycle.View, Iterable<SSTableReader>> function;
function = org.apache.cassandra.db.lifecycle.View.select(SSTableSet.CANONICAL, s -> range.intersects(s.getBounds()));
try (ColumnFamilyStore.RefViewFragment viewFragment = baseCfs.selectAndReference(function);
Refs<SSTableReader> sstables = viewFragment.refs;
ReducingKeyIterator keyIter = new ReducingKeyIterator(sstables))
{
PeekingIterator<DecoratedKey> iter = Iterators.peekingIterator(keyIter);
while (!isStopped && iter.hasNext())
{
DecoratedKey key = iter.next();
Token token = key.getToken();
//skip tokens already built or not present in range
if (range.contains(token) && (prevToken == null || token.compareTo(prevToken) > 0))
{
buildKey(key);
++keysBuilt;View on GitHub (pinned to 88fd0f6a0e)
Solutions
- Confirm all nodes have converged schema (nodetool describecluster / schematokens) and let the build proceed or restart it
- Fix any down or lagging nodes so schema agreement completes; then rebuild the view if mutations failed
- Increase tolerance by retrying the view build after convergence rather than during churn
- Check for schema version disagreements caused by failed schema migrations and repair system_schema on the outlier
Defensive patterns
Strategy: retry
Validate before calling
// before triggering view build, confirm schema agreement: // nodetool describecluster (all nodes same schema version) // nodetool status -> no down nodes
Prevention
- Create MVs during stable cluster state (no restarts in flight)
- Fix down nodes before schema changes
- Check gossip/schema propagation health before DDL
- If the warning appears, verify schema converged and rebuild if mutations failed
When it happens
Trigger: Gossiper.waitForSchemaAgreement(10, SECONDS, isStopped-check) returns false because at least one node has not applied the recent schema change within 10 seconds.
Common situations: CREATE MATERIALIZED VIEW executed while a node is down or gossips slowly; large schema backlogs; nodes restarting during the view creation; clock/gossip issues delaying schema push/pull.
Related errors
- 'Get CIDR groups for IP' operation not supported by %s
- ACCESS TO DATACENTERS operations not supported by AllowAllNe
- ALREADY_EXISTS
- WriteTimeoutException (WriteType.VIEW, ConsistencyLevel.LOCA
- Not adding view {} because the base table {} is unknown
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/e2166e50a0ffe70a.
Report an issue: GitHub.