Elasticsearch Version



Elasticsearch Version

Opster Team

July 2020, Version: 1.7-8.0


Before you begin reading the explanation below, try running the free ES Health Check-Up get actionable recommendations that can improve Elasticsearch performance and prevent serious incidents. Just 2 minutes to complete and you can check your threadpools, memory, snapshots and many more

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
}

Related log errors to this ES concept


No version match ; default to
Version and NOT supported for
Version of mappings for not found; recreating
Use of the low-level REST client on JDK 7 is deprecated and will be removed in version 7.0.0 of the client
Templates were upgraded successfully to version
Cluster state with version that is published locally has neither been processed nor failed
Error sending cluster state commit uuid ; version to
Publishing cluster state with version failed for the following nodes:
Unexpected failure during ; current state version
Failed to retrieve mapping version for ; recreating
Templates were partially upgraded to version
Starting template upgrade to version ; templates will be updated and will be removed

< Page: 1 of 2 >


About Opster

Opster detects, prevents, optimizes and automates everything needed to run mission-critical Elasticsearch

Find Configuration Errors

Analyze Now