Timed out waiting for relocation hand-off to complete – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 6.8-8.9

Briefly, this error occurs when Elasticsearch is unable to complete the relocation of shards within the set timeout period. This could be due to heavy indexing, slow network, or insufficient resources. To resolve this issue, you can increase the timeout period by adjusting the ‘cluster.routing.allocation.node_concurrent_recoveries’ setting. Alternatively, you can reduce the load on your cluster by decreasing the indexing rate or increasing the cluster’s resources. Lastly, ensure your network is stable and fast enough to handle the data transfer.

This guide will help you check for common problems that cause the log ” timed out waiting for relocation hand-off to complete ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: index, relocation, shard.

Log Context

Log “timed out waiting for relocation hand-off to complete” classname is IndexShard.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

                }

                @Override
                public void onFailure(Exception e) {
                    if (e instanceof TimeoutException) {
                        logger.warn("timed out waiting for relocation hand-off to complete");
                        // This is really bad as ongoing replication operations are preventing this shard from completing relocation
                        // hand-off.
                        // Fail primary relocation source and target shards.
                        failShard("timed out waiting for relocation hand-off to complete"; null);
                        listener.onFailure(

 

 [ratemypost]