5
votes

We are running elasticsearch on AWS which currently supports elasticsearch 6.3 as the latest version.

We have a business case where we need to update all the documents in the index and remove one nested object everyday. There is elasticsearch's Update by query API which will solve our purpose.

But in our java application we are using Java high level rest client. The update by query api is being supported by the rest client version 6.5. Now if we upgrade the rest client to 6.5, we need to upgrade the elasticsearch version in our pom as well. Otherwise they aren't compatible.

    <dependency>
        <groupId>org.elasticsearch.client</groupId>
        <artifactId>elasticsearch-rest-high-level-client</artifactId>
        <version>${elasticsearch.version}</version>
    </dependency>

    <dependency>
        <groupId>org.elasticsearch</groupId>
        <artifactId>elasticsearch</artifactId>
        <version>${elasticsearch.version}</version>
    </dependency>

So can we upgrade the client and elasticsearch version to 6.5 in our java service and still use the elasticsearch 6.3? I tried it and it works, but just want to be thorough as we don't want our data to be corrupted.

Edit: The Update by query is also available in 6.3 but this api uses the older Transportclient which is supposed to be deprecated soon.

2
Here's the recommendation from ElasticSearch documentation.Samuel Kok
Hi, how did it go? Did elasticsearch server 6.3 work well with elasticsearch client 6.5 version? Thanks.Ikrom

2 Answers

0
votes

According to Elasticsearch,

running a mixed version cluster is something we only recommend during the upgrade process, not as the status quo. Having older versions of nodes or clients in the cluster limits the support of newer features, as the older client simply doesn't know how to write or read requests in the newer binary format.

This should also apply the other way round (newer Client for old ES-Version)

In addidition, in this Recommendation, noted by @Samuel Kok, states:

The client should always be updated last, once all of the nodes in the cluster have been upgraded to the new major version.

0
votes

Based on the Elastic Search Documentation

The High Level Client is guaranteed to be able to communicate with any Elasticsearch node running on the same major version and greater or equal minor version.

The 6.0 client is able to communicate with any 6.x Elasticsearch node, while the 6.1 client is for sure able to communicate with 6.1, 6.2 and any later 6.x version, but there may be incompatibility issues when communicating with a previous Elasticsearch node version, for instance between 6.1 and 6.0, in case the 6.1 client supports new request body fields for some APIs that are not known by the 6.0 node(s).

In other words, the Java Rest Client should never be newer than the Elasticsearch node.

For your case, it strongly advised that you should either upgrade Elastic Search to 6.5 as well or downgrade your Java Rest Client back to 6.3.

Updated By Query is available in 6.3 as well so I don't see why you need to use version 6.5 of the Java Rest Client. Unless there is some new features within the Updated By Query API that is released in 6.5 which I'm unaware.