apache/cassandra · warning

Timed out while trying to append item to the log

Error message

Timed out while trying to append item to the log

What it means

A warn log in DistributedMetadataLogKeyspace.tryCommit when the CAS append of a metadata log entry times out (CasWriteTimeoutException). The method returns false, so the metadata transformation commit is not recorded and the caller must retry.

Solutions

  1. Ensure a quorum of log replicas is healthy and retry the schema/metadata operation
  2. Increase cassandra.write_request_timeout_in_ms for large/slow clusters
  3. Check replica GC/disk health and repair any node outages
  4. Retry the operation — the returned false indicates the caller retries the commit
Defensive patterns

Strategy: retry

Validate before calling

// check replica health before schema-mutating operations
if (!RangeCommands.sufficientLiveNodesForSelectStar(logTable, ConsistencyLevel.QUORUM))
    throw new IllegalStateException("Not enough live nodes for metadata log append");

Try / catch

try { committed = tryCommit(prevEpoch, transform, entryId, nextEpoch); }
catch (CasWriteTimeoutException e) {
    logger.warn("Append timed out; retrying commit", e);
    return false; // caller retries
}

Prevention

When it happens

Trigger: A CAS write appending an entry to the metadata log exceeds the write timeout at the requested consistency level — quorum replicas slow or unavailable during a schema/metadata change.

Common situations: Schema changes (CREATE/ALTER/DROP) issued while replicas are degraded; GC pauses or disk stalls on log replicas; too-low write_request_timeout_in_ms.

Understand the failure class

Related errors


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/f934771e0a152a5c. Report an issue: GitHub.

Appendix: source

Thrown at src/java/org/apache/cassandra/schema/DistributedMetadataLogKeyspace.java:153

            }

            ByteBuffer serializedTransform = transform.kind().toVersionedBytes(transform);
            String query = String.format("INSERT INTO %s.%s (epoch, entry_id, transformation, kind) " +
                                         "VALUES (?, ?, ?, ?) " +
                                         "IF NOT EXISTS;",
                                         METADATA_KEYSPACE_NAME, TABLE_NAME);
            UntypedResultSet result = QueryProcessor.execute(query,
                                                             ConsistencyLevel.QUORUM,
                                                             nextEpoch.getEpoch(),
                                                             entryId.entryId,
                                                             serializedTransform,
                                                             transform.kind().id);

            return result.one().getBoolean("[applied]");
        }
        catch (CasWriteTimeoutException t)
        {
            logger.warn("Timed out while trying to append item to the log", t);
            return false;
        }
        catch (Throwable t)
        {
            logger.error("Caught an exception while trying to CAS", t);
            return false;
        }
    }

    private static final LogReader localLogReader = new DistributedTableLogReader(ConsistencyLevel.NODE_LOCAL);
    private static final LogReader serialLogReader = new DistributedTableLogReader(ConsistencyLevel.SERIAL);

    public static LogState getLogState(Epoch since, boolean consistentFetch)
    {
        return (consistentFetch ? serialLogReader : localLogReader).getLogState(since);
    }

    public static class DistributedTableLogReader implements LogReader

View on GitHub (pinned to 88fd0f6a0e)