Source node does not have the shard listed in its state as allocated on the node – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 6.8-8.9

Before you dig into reading this guide, have you tried asking OpsGPT what this log means? You’ll receive a customized analysis of your log.

Try OpsGPT now for step-by-step guidance and tailored insights into your Elasticsearch operation.

Briefly, this error occurs when Elasticsearch tries to move a shard from one node to another, but the source node doesn’t have the shard listed as allocated to it. This could be due to a cluster state inconsistency or a network issue. To resolve this, you can try to manually reroute the shard using the cluster reroute API, or restart the node to refresh its state. If the problem persists, consider checking the cluster’s health and ensure that all nodes are properly connected and synchronized.

For a complete solution to your to your search operation, try for free AutoOps for Elasticsearch & OpenSearch . With AutoOps and Opster’s proactive support, you don’t have to worry about your search operation – we take charge of it. Get improved performance & stability with less hardware.

This guide will help you check for common problems that cause the log ” source node does not have the shard listed in its state as allocated on the node ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: recovery, indices, shard, node, source.

Log Context

Log “source node does not have the shard listed in its state as allocated on the node” class name is RecoverySourceHandler.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 logger.debug(
 "delaying recovery of {} as it is not listed as assigned to target node {}";
 request.shardId();
 request.targetNode()
 );
 throw new DelayRecoveryException("source node does not have the shard listed in its state as allocated on the node");
 }
 assert targetShardRouting.initializing() : "expected recovery target to be initializing but was " + targetShardRouting;
 retentionLeaseListener.onResponse(
 shard.getRetentionLeases().get(ReplicationTracker.getPeerRecoveryRetentionLeaseId(targetShardRouting))
 );

 

How helpful was this guide?

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?