Recovery was cancelled – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 7.8-8.9

Briefly, this error occurs when the recovery process of an Elasticsearch shard is interrupted or stopped. This could be due to a node leaving the cluster, a higher priority recovery process starting, or manual intervention. To resolve this issue, you can try restarting the recovery process, ensure that all nodes are stable and connected to the cluster, or check for any ongoing processes that might interfere with the recovery. If the problem persists, consider increasing the cluster’s resilience by adding more nodes or improving network stability.

This guide will help you check for common problems that cause the log ” recovery was cancelled ” 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 was cancelled” class name is RemoteRecoveryTargetHandler.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 public void cancel() {
 isCancelled = true;
 if (onGoingRetryableActions.isEmpty()) {
 return;
 }
 final RuntimeException exception = new CancellableThreads.ExecutionCancelledException("recovery was cancelled");
 // Dispatch to generic as cancellation calls can come on the cluster state applier thread
 threadPool.generic().execute(() -> {
 for (RetryableAction action : onGoingRetryableActions.values()) {
 action.cancel(exception);
 }

 

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?