How To Solve Issues Related to Log – No version match ; default to

Improve Your Elasticsearch Configuration

No Installation Required
No Security Risk
3 Free Minute Process !

No Installation

Updated: Jan-20

In-Page Navigation (click to jump) :

Opster Offer’s World-Class Elasticsearch Expertise In One Powerful Product
Try Our Free Elasticsearch Check-Up   Fix Painful Mistakes !

Troubleshooting background

To troubleshoot Elasticsearch log “No version match ; default to” it’s important to understand common problems related to Elasticsearch concepts: lucene, version. See detailed explanations below complete with common problems, examples and useful tips.

Lucene and Elasticsearch

What it is 

Lucene or Apache Lucene is an open-source Java library used as a search engine. Elasticsearch is built on top of Lucene. 

Elasticsearch converts Lucene into a distributed system/search engine for scaling horizontally. Elasticsearch also provides other features like thread-pool, queues, node/cluster monitoring API, data monitoring API, Cluster management, etc. In short , Elasticsearch extends Lucene and provides additional features in addition to it.

Elasticsearch hosts data on data nodes. Each data node hosts one or more indices , and each index is divided into shards with each shard holding part of the index data. From technical and operative perspectives, each shard created in Elasticsearch is a separate Lucene instance or process. Therefore, this concept is of significant importance when attempting to understand elasticsearch internals , indices and shards.

Notes and Good Things to Know:
  • When an index is created in ElasticSearch it is divided into one or more primary shards for scaling the data and splitting it into multiple nodes/instances. The concept of Lucene is relevant here when you are going to decide the number of shards for your index. Too many shards will result in too many Lucene instances, which will consume resources and damage performance.

  • It takes proper planning to decide the number of primary shards for your index , taking into account the index size , max growth , and the number of data nodes.

  • Previous versions of Elasticsearch defaulted to creating five shards per index. Starting with 7.0.0, the default is now one shard per index.

Version in Elasticsearch


A version corresponds to the Elasticsearch built-in tracking system that tracks the changes in each document’s update. When a document is indexed for the first time, it is assigned a version 1 using _version key. When the same document gets a subsequent update, the _version is incremented by 1 with every index, update or delete API call.

What it is used for

A version is used to handle the concurrency issues in Elasticsearch which come into play during simultaneous accessing of an index by multiple users. Elasticsearch handles this issue with an optimistic locking concept using the _version parameter to avoid letting multiple users edit the same document at the same time and protects users from generating incorrect data.

Notes

You cannot see the history of the document using _version. That means Elasticsearch does not use _version to keep a track of original changes that had been performed on the document. For example, if a document has been updated 10 times, it’s _version would be marked by Elasticsearch as 11, but you cannot go back and see what version 5 of the document looked like. This has to be implemented independently.

Common Problems

If optimistic locking is not implemented while making updates to a document, Elasticsearch may return a conflict error with the 409 status code, which means that multiple users are trying to update the same version of the document at the same time.

POST /ratings/123?version=50
{
    "name": "Joker",
    "rating": 50
}


To help troubleshoot related issues we have gathered selected Q&A from the community and issues from Github , please review the following for further information :

1 Github Issue Number 6441  

2Elasticsearchillegalargumentexcepti  


Log Context

Log ”No version match {}; default to {}” classname is Lucene.java
We have extracted the following from Elasticsearch source code to get an in-depth context :

             return defaultVersion;
        }
        try {
            return Version.parse(version);
        } catch (ParseException e) {
            logger.warn(() -> new ParameterizedMessage("no version match {}; default to {}"; version; defaultVersion); e);
            return defaultVersion;
        }
    }

    /**






About Opster

Opster identifies and predicts root causes of Elasticsearch problems, provides recommendations and can automatically perform various actions to prevent issues, optimize performance and save resources.

Learn more: Glossary | Blog| Troubleshooting guides | Error Repository

Need help with any Elasticsearch issue ? Contact Opster