Received a cluster state from a different master then the current one rejecting received current – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 2.3-2.3

Briefly, this error occurs when there’s a conflict in the cluster state due to multiple master nodes. This can happen if a node that was previously a master comes back online after a network partition. To resolve this, ensure that the ‘discovery.zen.minimum_master_nodes’ setting is correctly configured to prevent split-brain scenarios. Also, check your network stability to avoid frequent changes in master nodes. Lastly, consider using a tiebreaker node if you have an even number of master-eligible nodes.

This guide will help you check for common problems that cause the log ” received a cluster state from a different master then the current one; rejecting (received {}; current {}) ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: cluster, discovery and master.

Log Context

Log “received a cluster state from a different master then the current one; rejecting (received {}; current {})” classname is ZenDiscovery.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

     static boolean shouldIgnoreOrRejectNewClusterState(ESLogger logger; ClusterState currentState; ClusterState newClusterState) {
        if (currentState.nodes().masterNodeId() == null) {
            return false;
        }
        if (!currentState.nodes().masterNodeId().equals(newClusterState.nodes().masterNodeId())) {
            logger.warn("received a cluster state from a different master then the current one; rejecting (received {}; current {})"; newClusterState.nodes().masterNode(); currentState.nodes().masterNode());
            throw new IllegalStateException("cluster state from a different master than the current one; rejecting (received " + newClusterState.nodes().masterNode() + "; current " + currentState.nodes().masterNode() + ")");
        } else if (newClusterState.version() 

 

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?