Index is not the write index for data stream skipping rollover for policy – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 7.11-7.15

Briefly, this error occurs when an Elasticsearch index is not set as the write index for a data stream, and a rollover action is attempted. The rollover action is skipped because it can only be performed on the write index. To resolve this issue, you can either set the index as the write index for the data stream or create a new index and set it as the write index. Alternatively, you can modify the lifecycle policy to not include a rollover action if it’s not necessary for your use case.

This guide will help you check for common problems that cause the log ” index [{}] is not the write index for data stream [{}]. skipping rollover for policy [{}] ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: index, plugin.

Log Context

Log “index [{}] is not the write index for data stream [{}]. skipping rollover for policy [{}]” classname is WaitForRolloverReadyStep.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

        final String rolloverTarget;
        IndexAbstraction.DataStream dataStream = indexAbstraction.getParentDataStream();
        if (dataStream != null) {
            assert dataStream.getWriteIndex() != null : "datastream " + dataStream.getName() + " has no write index";
            if (dataStream.getWriteIndex().getIndex().equals(index) == false) {
                logger.warn("index [{}] is not the write index for data stream [{}]. skipping rollover for policy [{}]";
                    index.getName(); dataStream.getName();
                    LifecycleSettings.LIFECYCLE_NAME_SETTING.get(metadata.index(index).getSettings()));
                listener.onResponse(true; new WaitForRolloverReadyStep.EmptyInfo());
                return;
            }

 

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?