Relocated shard to node during primary Rebalance – How to solve this OpenSearch error

Opster Team

Aug-23, Version: 2.4-2.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 OpenSearch operation.

Briefly, this error occurs when OpenSearch is in the process of balancing the distribution of its data across the nodes in a cluster. It’s a normal part of OpenSearch’s operation to ensure optimal performance and redundancy. The shard has been moved to a different node during a primary rebalance. To resolve this, no action is typically required as this is part of OpenSearch’s automatic management. However, if you notice frequent rebalancing or performance issues, consider reviewing your shard allocation settings or cluster capacity to ensure it’s adequate for your data and query load.

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 ” Relocated shard [{}] to node [{}] during primary Rebalance ” to appear. To understand the issues related to this log, read the explanation below about the following OpenSearch concepts: cluster, rebalance, shard, node, allocation, routing.

Log Context

Log “Relocated shard [{}] to node [{}] during primary Rebalance” classname is RemoteShardsBalancer.java.
We extracted the following from OpenSearch source code for those seeking an in-depth context :

        // Perform the relocation of allocation and rebalance decisions are YES
        if ((allocationDecision.type() == Decision.Type.YES) && (rebalanceDecision.type() == Decision.Type.YES)) {
            final long shardSize = allocation.clusterInfo().getShardSize(shard; ShardRouting.UNAVAILABLE_EXPECTED_SHARD_SIZE);
            ShardRouting targetShard = routingNodes.relocateShard(shard; destinationNode.nodeId(); shardSize; allocation.changes()).v2();
            logger.info("Relocated shard [{}] to node [{}] during primary Rebalance"; shard; targetShard.currentNodeId());
            return Decision.YES;
        }

        if ((allocationDecision.type() == Decision.Type.THROTTLE) || (rebalanceDecision.type() == Decision.Type.THROTTLE)) {
            return Decision.THROTTLE;

 

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?

Get expert answers on Elasticsearch/OpenSearch