Detected new primary with primary term global checkpoint max seq no – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 6.8-7.15

Briefly, this error occurs when Elasticsearch detects a new primary shard with a higher primary term, but its global checkpoint or max sequence number is lower than the existing primary shard. This could be due to a network partition or a node failure. To resolve this issue, you can try to restart the Elasticsearch node, or manually force a new primary shard. If the problem persists, consider checking your cluster health and ensure that all nodes are properly communicating with each other. Also, ensure that your Elasticsearch version is up-to-date as this could be a bug in older versions.

This guide will help you check for common problems that cause the log ” detected new primary with primary term [{}]; global checkpoint [{}]; max_seq_no [{}] ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: index, shard.

Log Context

Log “detected new primary with primary term [{}]; global checkpoint [{}]; max_seq_no [{}]” classname is IndexShard.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

                    bumpPrimaryTerm(opPrimaryTerm; () -> {
                        updateGlobalCheckpointOnReplica(globalCheckpoint; "primary term transition");
                        final long currentGlobalCheckpoint = getLastKnownGlobalCheckpoint();
                        final long maxSeqNo = seqNoStats().getMaxSeqNo();
                        logger.info("detected new primary with primary term [{}]; global checkpoint [{}]; max_seq_no [{}]";
                            opPrimaryTerm; currentGlobalCheckpoint; maxSeqNo);
                        if (currentGlobalCheckpoint 

 

 [ratemypost]