Recovery after time elapsed performing state recovery – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 1.3-1.3

Briefly, this error occurs when Elasticsearch takes too long to recover its state after a node failure or restart. This could be due to large data volumes, slow network, or hardware issues. To resolve this, you can increase the recovery timeout settings in Elasticsearch configuration. Alternatively, consider optimizing your index by reducing shard count, increasing heap size, or upgrading your hardware. Regularly monitoring and maintaining your Elasticsearch cluster can also help prevent such issues.

This guide will help you check for common problems that cause the log ” recovery_after_time [{}] elapsed. performing state recovery… ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: bootstrap.

Log Context

Log “recovery_after_time [{}] elapsed. performing state recovery…” classname is GatewayService.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

                 logger.info("delaying initial state recovery for [{}]. {}"; recoverAfterTime; reason);
                threadPool.schedule(recoverAfterTime; ThreadPool.Names.GENERIC; new Runnable() {
                    
Override
                    public void run() {
                        if (recovered.compareAndSet(false; true)) {
                            logger.info("recovery_after_time [{}] elapsed. performing state recovery..."; recoverAfterTime);
                            gateway.performStateRecovery(recoveryListener);
                        }
                    }
                });
            }



 

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?