Starting to track leader shard – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 6.8-8.9

Briefly, this error occurs when Elasticsearch begins to track the leader shard in a replication process. It’s not an error, but an informational message indicating that the Elasticsearch node has started to replicate data from the leader shard. If you’re seeing this message frequently, it might be due to network instability or node failures causing frequent leader changes. To resolve this, ensure your network is stable, your nodes are healthy, and your cluster is properly configured. Also, consider adjusting your shard allocation settings to prevent frequent leader changes.

This guide will help you check for common problems that cause the log ” {} Starting to track leader shard {} ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin, shard.

Log Context

Log “{} Starting to track leader shard {}” classname is ShardFollowTasksExecutor.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

    @Override
    protected void nodeOperation(final AllocatedPersistentTask task; final ShardFollowTask params; final PersistentTaskState state) {
        Client followerClient = wrapClient(client; params.getHeaders(); clusterService.state());
        ShardFollowNodeTask shardFollowNodeTask = (ShardFollowNodeTask) task;
        logger.info("{} Starting to track leader shard {}"; params.getFollowShardId(); params.getLeaderShardId());

        FollowerStatsInfoHandler handler = (followerHistoryUUID; followerGCP; maxSeqNo) -> {
            shardFollowNodeTask.start(followerHistoryUUID; followerGCP; maxSeqNo; followerGCP; maxSeqNo);
        };
        Consumer errorHandler = e -> {

 

 [ratemypost]