Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A Get request with a version set should always validate for equality #5663

Closed
bleskes opened this issue Apr 2, 2014 · 0 comments
Closed

Comments

@bleskes
Copy link
Contributor

bleskes commented Apr 2, 2014

Currently we use the same version checking logic for get and indexing requests. The leads to the wrong semantics for the EXTERNAL and the EXTERNAL_TYPE versioning systems. For example, doing GET index/type/1?version=10&version_type=external will return the document if it has a version of 9 or less.

We should make it return documents only if their version match the specified version.

@bleskes bleskes self-assigned this Apr 2, 2014
bleskes added a commit to bleskes/elasticsearch that referenced this issue Apr 24, 2014
…n read operation & disallow them in the Update API

Separate version check logic for reads and writes for all version types, which allows different behavior in these cases.
Change `VersionType.EXTERNAL` & `VersionType.EXTERNAL_GTE` to behave the same as `VersionType.INTERNAL` for read operations.
The previous behavior was fit for writes but is useless in reads.

This commit also makes the usage of `EXTERNAL` & `EXTERNAL_GTE` in the update api raise a validation error as it make cause data to
be lost.

Closes elastic#5663 , closes elastic#5661
@s1monw s1monw added the blocker label Apr 24, 2014
bleskes added a commit that referenced this issue Apr 25, 2014
…n read operation & disallow them in the Update API

Separate version check logic for reads and writes for all version types, which allows different behavior in these cases.
Change `VersionType.EXTERNAL` & `VersionType.EXTERNAL_GTE` to behave the same as `VersionType.INTERNAL` for read operations.
The previous behavior was fit for writes but is useless in reads.

This commit also makes the usage of `EXTERNAL` & `EXTERNAL_GTE` in the update api raise a validation error as it make cause data to
be lost.

Closes #5663 , Closes #5661, Closes #5929
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment