Adding segment to be upgraded – How to solve this OpenSearch error

Opster Team

Aug-23, Version: 1-2.9

Before you dig into reading this guide, have you tried asking OpsGPT what this log means? You’ll receive a customized analysis of your log.

Try OpsGPT now for step-by-step guidance and tailored insights into your OpenSearch operation.

Briefly, this error occurs when OpenSearch identifies a segment in the index that is created with an older version and needs to be upgraded to the current version. This is not necessarily a problem, but an informational message. However, if it’s causing issues, you can resolve it by reindexing your data to the current version, or by using the “_upgrade” API to upgrade the segments manually. Also, ensure that your OpenSearch cluster is running on the same version to avoid such discrepancies.

For a complete solution to your to your search operation, try for free AutoOps for Elasticsearch & OpenSearch . With AutoOps and Opster’s proactive support, you don’t have to worry about your search operation – we take charge of it. Get improved performance & stability with less hardware.

This guide will help you check for common problems that cause the log ” Adding segment {} to be upgraded ” to appear. To understand the issues related to this log, read the explanation below about the following OpenSearch concepts: index, shard.

Log Context

Log “Adding segment {} to be upgraded” classname is OpenSearchMergePolicy.java.
We extracted the following from OpenSearch source code for those seeking an in-depth context :

                if (shouldUpgrade(info)) {

                    // TODO: Use IndexUpgradeMergePolicy instead. We should be comparing codecs;
                    // for now we just assume every minor upgrade has a new format.
                    logger.debug("Adding segment {} to be upgraded"; info.info.name);
                    spec.add(new OneMerge(Collections.singletonList(info)));
                }

                // TODO: we could check IndexWriter.getMergingSegments and avoid adding merges that IW will just reject?

 

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?

Get expert answers on Elasticsearch/OpenSearch