How To Solve Issues Related to Log – unexpected error while failing replica

Get an Elasticsearch Check-Up


Check if your ES issues are caused from misconfigured settings
(Free 2 min process)

ES Check Up

Elasticsearch Error Guide In Page Navigation :

Troubleshooting Background – start here to get the full picture       
Related Issues – selected resources on related issues  
Log Context – usefull for experts
About Opster – offering a diffrent approach to troubleshoot Elasticsearch

Check My Elasticsearch 


Troubleshooting background

To troubleshoot Elasticsearch log “unexpected error while failing replica” it’s important to know common problems related to Elasticsearch concepts: replication. See below-detailed explanations complete with common problems, examples and useful tips.

Replication in Elasticsearch

What it is

Replication refers to storing the redundant copy of the data. Starting from version 7.x, Elasticsearch creates one primary shard with a replication factor set to 1.  Replicas never get assigned on the same node on which primary shards are assigned, which means you should have at least two nodes in the cluster to assign the replicas. If a primary shard goes down, the replica automatically acts as a primary shard.

What it is used for

Replicas are used to provide high availability and failover. A higher number of replicas is also helpful for faster searches.

Examples

Update replication count

PUT /api-logs/_settings?pretty
{
    "index" : {
        "number_of_replicas" : 2
    }
}
Common problems
  • By default, If free disk space usage reaches 85%, the replicas of newly created indices are not assigned on that node and Elasticsearch throws a warning.
  • Creating too many replicas may cause a problem if there are not enough resources available in the cluster. 


To help troubleshoot related issues we have gathered selected Q&A from the community and issues from Github , please review the following for further information :

Failed To Recover From Translog Cur
discuss.elastic.co/t/failed-to-recover-from-translog-currentstate-closed/192529

 

Github Issue Number 14905
github.com/elastic/elasticsearch/issues/14905

 


Log Context

Log ”unexpected error while failing replica” classname is TransportReplicationAction.java
We have extracted the following from Elasticsearch source code to get an in-depth context :

                 });
            } else {
                try {
                    failReplicaIfNeeded(t);
                } catch (Throwable unexpected) {
                    logger.error("{} unexpected error while failing replica"; unexpected; request.shardId().id());
                } finally {
                    responseWithFailure(t);
                }
            }
        }






About Opster

Incorporating deep knowledge and broad history of Elasticsearch issues. Opster’s solution identifies and predicts root causes of Elasticsearch problems, provides recommendations and can automatically perform various actions to manage, troubleshoot and prevent issues

We are constantly updating our analysis of Elasticsearch logs, errors, and exceptions. Sharing best practices and providing troubleshooting guides.

Learn more: Glossary | Blog| Troubleshooting guides | Error Repository

Need help with any Elasticsearch issue ? Contact Opster

Did this page help you?