apache/cassandra · error · UnsupportedOperationException

Cannot replace a live node...

Error message

Cannot replace a live node... 

What it means

When this node is configured to replace another node, Startup checks the replace target's liveness via the FailureDetector; if the target is considered alive, replacement is refused with UnsupportedOperationException because replacing a live node would fork cluster state and data ownership.

Source

Thrown at src/java/org/apache/cassandra/tcm/Startup.java:737

    /**
     * Returns:
     *   * {@link PrepareReplace}, the first step of the multi-step replacement process sequence, if {@param finishJoiningRing} is true
     *   * {@link UnsafeJoin}, a single-step join transformation, if {@param shouldBootstrap} is set to false, and the node is not
     *     in a write survey mode (in other words {@param finishJoiningRing} is true. This mode is mostly used for testing, but can
     *     also be used to quickly set up a fresh cluster.
     *   * and {@link PrepareJoin}, the first step of the multi-step join process, otherwise.
     */
    private static Transformation getInitialTransformation(boolean finishJoiningRing, boolean shouldBootstrap, boolean isReplacing)
    {
        ClusterMetadata metadata = ClusterMetadata.current();
        if (isReplacing)
        {
            InetAddressAndPort replacingEndpoint = DatabaseDescriptor.getReplaceAddress();
            if (FailureDetector.instance.isAlive(replacingEndpoint))
            {
                logger.error("Unable to replace live node {})", replacingEndpoint);
                throw new UnsupportedOperationException("Cannot replace a live node... ");
            }

            NodeId replaced = ClusterMetadata.current().directory.peerId(replacingEndpoint);

            return new PrepareReplace(replaced,
                                      metadata.myNodeId(),
                                      ClusterMetadataService.instance().placementProvider(),
                                      finishJoiningRing,
                                      shouldBootstrap);
        }
        else if (finishJoiningRing && !shouldBootstrap)
        {
            return new UnsafeJoin(metadata.myNodeId(),
                                  new HashSet<>(BootStrapper.getBootstrapTokens(ClusterMetadata.current(), getBroadcastAddressAndPort())),
                                  ClusterMetadataService.instance().placementProvider());
        }
        else
        {

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Verify the replace target is truly down; wait until FailureDetector marks it dead (check nodetool gossipinfo / status)
  2. Correct cassandra.replace_address if it points at the wrong node
  3. Restart this node once the target is confirmed dead (the check runs at startup only)
  4. If a liveness false-positive persists, inspect network/phi-conviction threshold settings

Example fix

// before
cassandra.replace_address=10.0.0.7   # still alive
// after
# confirm 10.0.0.7 is down, then
cassandra.replace_address=10.0.0.7   # marked dead by failure detector
Defensive patterns

Strategy: validation

Validate before calling

if (FailureDetector.instance.isAlive(InetAddressAndPort.getByNameByName(replaceAddress)))
    throw new IllegalArgumentException("Replace target is still alive");

Prevention

When it happens

Trigger: cassandra.replace_address set to a host that the FailureDetector currently reports as alive (isAlive returns true) when getInitialTransformation builds the PrepareReplace step.

Common situations: Typo in cassandra.replace_address pointing at a healthy node; the target node actually restarted and is healthy; gossip/failure-detector stale state briefly marking a dead node alive; automation misconfiguring replacement variables.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


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