Recovery with same target already registered waiting for – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 6.8-7.15

Briefly, this error occurs when Elasticsearch tries to recover a shard but finds that a recovery process for the same shard is already in progress. This could be due to a network glitch or a node failure. To resolve this issue, you can try the following: 1) Restart the Elasticsearch node, this might help to reset the recovery process. 2) Check the cluster health and ensure all nodes are properly connected. 3) If the error persists, you may need to manually reroute the shard using the cluster reroute API.

This guide will help you check for common problems that cause the log ” recovery with same target already registered; waiting for ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: recovery, indices.

Log Context

Log “recovery with same target already registered; waiting for” class name is PeerRecoverySourceService.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 */
 synchronized Tuple addNewRecovery(StartRecoveryRequest request;
 IndexShard shard) {
 for (RecoverySourceHandler existingHandler : recoveryHandlers.keySet()) {
 if (existingHandler.getRequest().targetAllocationId().equals(request.targetAllocationId())) {
 throw new DelayRecoveryException("recovery with same target already registered; waiting for " +
 "previous recovery attempt to be cancelled or completed");
 }
 }
 final Tuple handlers = createRecoverySourceHandler(request; shard);
 recoveryHandlers.put(handlers.v1(); handlers.v2());

 

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?