apache/cassandra · error · IllegalStateException

Can't commit transformations when running in gossip mode. En

Error message

Can't commit transformations when running in gossip mode. Enable the ClusterMetadataService with `nodetool cms initialize`.

What it means

GossipProcessor is the Processor used while the cluster still runs in gossip mode. TCM transformations (metadata commits) can only be applied through the CMS-backed processor, so commit() unconditionally throws IllegalStateException directing the operator to initialize the CMS with `nodetool cms initialize`.

Source

Thrown at src/java/org/apache/cassandra/tcm/migration/GossipProcessor.java:34

 * limitations under the License.
 */

package org.apache.cassandra.tcm.migration;

import org.apache.cassandra.tcm.ClusterMetadata;
import org.apache.cassandra.tcm.Commit;
import org.apache.cassandra.tcm.Epoch;
import org.apache.cassandra.tcm.Processor;
import org.apache.cassandra.tcm.Retry;
import org.apache.cassandra.tcm.Transformation;
import org.apache.cassandra.tcm.log.Entry;

public class GossipProcessor implements Processor
{
    @Override
    public Commit.Result commit(Entry.Id entryId, Transformation transform, Epoch lastKnown, Retry retryPolicy)
    {
        throw new IllegalStateException("Can't commit transformations when running in gossip mode. Enable the ClusterMetadataService with `nodetool cms initialize`.");
    }

    @Override
    public ClusterMetadata fetchLogAndWait(Epoch waitFor, Retry retryPolicy)
    {
        return ClusterMetadata.current();
    }
}

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Run `nodetool cms initialize` on one node to elect a CMS and switch out of gossip mode
  2. After initialization completes, retry the failed transformation/operation
  3. Verify cassandra.yaml/mode configuration so the node uses the same metadata mode as the rest of the cluster
  4. If migration is intended but stuck, fix the underlying migration errors (down peers, metadata mismatch) first

Example fix

// before
// gossip-mode cluster:
ClusterMetadataService.instance().getProcessor().commit(...); // throws
// after
// $ nodetool cms initialize
ClusterMetadataService.instance().getProcessor().commit(...);
Defensive patterns

Strategy: try-catch

Validate before calling

if (!ClusterMetadataService.instance().isInitialized()) throw new IllegalStateException("CMS not initialized; run nodetool cms initialize first");

Type guard

boolean cmsEnabled() { return !(ClusterMetadataService.instance().getProcessor() instanceof GossipProcessor); }

Try / catch

try { processor.commit(entryId, transform, lastKnown, retry); } catch (IllegalStateException e) { // prompt operator to run `nodetool cms initialize`, then retry }

Prevention

When it happens

Trigger: Any code path committing a Transformation (e.g. cluster metadata changes, node join/leave operations) while ClusterMetadataService is still in gossip (pre-migration) mode, so the active processor is GossipProcessor.

Common situations: Attempting TCM-only operations on a cluster not yet migrated to TCM; tools/tests that assume CMS mode on a legacy gossip cluster; a node that started with gossip configuration in an otherwise TCM cluster (config mismatch).

Related errors


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