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
- Verify the replace target is truly down; wait until FailureDetector marks it dead (check nodetool gossipinfo / status)
- Correct cassandra.replace_address if it points at the wrong node
- Restart this node once the target is confirmed dead (the check runs at startup only)
- 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
- Confirm the target is powered off and unreachable before setting cassandra.replace_address
- Double-check replace_address against cluster state (nodetool status) to avoid typos
- Serialize replacement ops so the target cannot restart concurrently
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
- Cannot replace same address when accord transactions are ena
- %s has authorization enabled which requires %s to enable aut
- %s requires %s
- %s can't be used with %s
- %s does not support %s
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/b485efa7122a5876.
Report an issue: GitHub.