How To Solve Issues Related to Log – Recovery failed for primary shadow shard; failing shard

How To Solve Issues Related to Log – Recovery failed for primary shadow shard; failing shard

Updated: Feb-20

Elasticsearch Version: 1.7-8.0

Background

Before you begin reading this guide try our beta Elasticsearch Health Check-Up it analyses JSON’s to provide personalized recommendations that can improve your clusters performance.


To troubleshoot log “Recovery failed for primary shadow shard; failing shard” it’s important to understand a few problems related to Elasticsearch concepts handler, indices, recovery, shard, source. See bellow important tips and explanations on these concepts

Log Context

Log”recovery failed for primary shadow shard; failing shard” classname is SharedFSRecoverySourceHandler.java
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

             if (engineClosed) {
                // If the relocation fails then the primary is closed and can't be
                // used anymore... (because it's closed) that's a problem; so in
                // that case; fail the shard to reallocate a new IndexShard and
                // create a new IndexWriter
                logger.info("recovery failed for primary shadow shard; failing shard");
                // pass the failure as null; as we want to ensure the store is not marked as corrupted
                shard.failShard("primary relocation failed on shared filesystem caused by: [" + t.getMessage() + "]"; null);
            } else {
                logger.info("recovery failed on shared filesystem"; t);
            }




Related issues to this log

We have gathered selected Q&A from the community and issues from Github, that can help fix related issues please review the following for further information :

1 Failing to start shard in ElasticSearch IndexShardGatewayRecoveryException “sending failed”

13.09 K 9

Github Issue Number 23199  

About Opster

Opster detects root causes of Elasticsearch problems, provides automated recommendations and can perform various actions to prevent issues and optimize performance

Find Configuration Errors

Analyze Now