apache/cassandra · critical · IllegalStateException
Tried to commit when in gossip mode
Error message
Tried to commit when in gossip mode
What it means
Commit.checkCMSState validates the sender's ClusterMetadataService state before processing a commit via Commit.doVerb. When the local CMS state is GOSSIP, the node is operating in gossip-based cluster-metadata mode rather than TCM mode, and metadata commits are invalid; the code logs the message via logger.error and throws IllegalStateException. This is an internal-mode invariant check: a TCM commit verb should never arrive (or be processed) while the node is in gossip mode.
Source
Thrown at src/java/org/apache/cassandra/tcm/Commit.java:424
logger.info("Responding with full result {} to sender {}", result, message.from());
}
messagingService.accept(message.responseWith(result), message.from());
}
private void checkCMSState()
{
switch (cmsStateSupplier.get())
{
case RESET:
case LOCAL:
break;
case REMOTE:
throw new NotCMSException("Not currently a member of the CMS, can't commit");
case GOSSIP:
String msg = "Tried to commit when in gossip mode";
logger.error(msg);
throw new IllegalStateException(msg);
default:
throw new IllegalStateException("Illegal state: " + cmsStateSupplier.get());
}
}
}
public interface Replicator
{
Replicator NO_OP = (a,b) -> {};
void send(Result result, InetAddressAndPort source);
}
public static class DefaultReplicator implements Replicator
{
public static class RoutingHelper
{
private final Directory directory;
private final EndpointLookup endpoints;View on GitHub (pinned to 88fd0f6a0e)
Solutions
- Verify the cluster is running in TCM mode: check ClusterMetadataService state and that the target node is a current CMS member before sending commits.
- Ensure all nodes are upgraded and ClusterMetadataService.instance().isCurrentMember(address) is true for the recipient; re-run the CMS placement/registration if membership is missing.
- Check for mixed-version or misconfigured nodes routing Commit verbs across mode boundaries; align node versions and retry after the node joins the CMS.
- If this appears during a controlled gossip->TCM transition, allow the transition to complete before issuing metadata changes.
Example fix
// guard before sending a commit
if (ClusterMetadataService.instance().isCurrentMember(FBUtilities.getBroadcastAddressAndPort()))
{
Commit.instance().commit(proposed);
}
else
{
logger.warn("Skipping TCM commit: node is not a CMS member (gossip mode)");
} Defensive patterns
Strategy: validation
Validate before calling
if (ClusterMetadataService.instance().isCurrentMember(FBUtilities.getBroadcastAddressAndPort())
&& ClusterMetadataService.instance().state() != ClusterMetadataService.CMSState.GOSSIP)
{
Commit.instance().commit(proposed);
} Try / catch
try { Commit.instance().commit(proposed); } catch (IllegalStateException e) { if (e.getMessage().contains("gossip mode")) logger.warn("Node in gossip mode; TCM commit rejected"); else throw e; } Prevention
- Confirm the cluster runs in TCM mode before issuing metadata changes
- Check isCurrentMember() before sending commits to a peer
- Avoid mixing gossip-mode and TCM-mode nodes during upgrades
When it happens
Trigger: A TCM Commit verb is dispatched to doVerb while ClusterMetadataService state resolves to CMSState.GOSSIP (cluster not using TCM / CMS, or the node hasn't been registered as a CMS member); checkCMSState's switch on cmsStateSupplier.get() hits the GOSSIP case at Commit.java:424.
Common situations: Clusters migrated from or started in gossip mode receiving stale/misrouted TCM messages; a node whose CMS membership was lost or not yet established handling an in-flight commit; mixed-version rolling upgrade where an old node routes metadata commits to a gossip-mode node.
Understand the failure class
Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.
Related errors
- Illegal state:
- Node %s is not a CMS member in epoch %s; members=%s
- Can only initialize cluster identifier during epoch %d, but
- Initial CMS node needs to be fully joined, not: %s
- Can't upgrade from gossip since CMS is already initialized
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/75a86552ad84df3d.
Report an issue: GitHub.