Starting segment upgrade upgradeOnlyAncientSegments= – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 6.8-7.17

Briefly, this error occurs when Elasticsearch is attempting to upgrade old segments in the index that are using an outdated format. This is a part of Elasticsearch’s internal maintenance process and usually doesn’t require any user intervention. However, if it’s causing issues, you can try to manually force a merge of the index segments, or if the index is not needed, you can delete it. If the problem persists, consider reindexing your data into a new index with the latest version of Elasticsearch.

This guide will help you check for common problems that cause the log ” starting segment upgrade upgradeOnlyAncientSegments={} ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: index, upgrade.

Log Context

Log “starting segment upgrade upgradeOnlyAncientSegments={}” classname is
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

        ElasticsearchMergePolicy mp = (ElasticsearchMergePolicy) indexWriter.getConfig().getMergePolicy();
        try {
            if (upgrade) {
      "starting segment upgrade upgradeOnlyAncientSegments={}"; upgradeOnlyAncientSegments);
                mp.setUpgradeInProgress(true; upgradeOnlyAncientSegments);
            store.incRef(); // increment the ref just to ensure nobody closes the store while we optimize
            try {
                if (onlyExpungeDeletes) {


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?