Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Version types
EXTERNAL
& EXTERNAL_GTE
test for version equality i…
…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
- Loading branch information
Showing
22 changed files
with
460 additions
and
223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
--- | ||
"Versions": | ||
|
||
- do: | ||
index: | ||
index: test_1 | ||
type: test | ||
id: 1 | ||
body: { foo: bar } | ||
- match: { _version: 1} | ||
|
||
- do: | ||
index: | ||
index: test_1 | ||
type: test | ||
id: 1 | ||
body: { foo: bar } | ||
- match: { _version: 2} | ||
|
||
- do: | ||
get: | ||
index: test_1 | ||
type: test | ||
id: 1 | ||
version: 2 | ||
- match: { _id: "1" } | ||
|
||
- do: | ||
catch: conflict | ||
get: | ||
index: test_1 | ||
type: test | ||
id: 1 | ||
version: 1 | ||
|
||
- do: | ||
get: | ||
index: test_1 | ||
type: test | ||
id: 1 | ||
version: 2 | ||
version_type: external | ||
- match: { _id: "1" } | ||
|
||
- do: | ||
catch: conflict | ||
get: | ||
index: test_1 | ||
type: test | ||
id: 1 | ||
version: 10 | ||
version_type: external | ||
|
||
- do: | ||
catch: conflict | ||
get: | ||
index: test_1 | ||
type: test | ||
id: 1 | ||
version: 1 | ||
version_type: external | ||
|
||
- do: | ||
get: | ||
index: test_1 | ||
type: test | ||
id: 1 | ||
version: 2 | ||
version_type: external_gte | ||
- match: { _id: "1" } | ||
|
||
- do: | ||
catch: conflict | ||
get: | ||
index: test_1 | ||
type: test | ||
id: 1 | ||
version: 10 | ||
version_type: external_gte | ||
|
||
- do: | ||
catch: conflict | ||
get: | ||
index: test_1 | ||
type: test | ||
id: 1 | ||
version: 1 | ||
version_type: external_gte | ||
|
||
- do: | ||
get: | ||
index: test_1 | ||
type: test | ||
id: 1 | ||
version: 2 | ||
version_type: force | ||
- match: { _id: "1" } | ||
|
||
- do: | ||
get: | ||
index: test_1 | ||
type: test | ||
id: 1 | ||
version: 10 | ||
version_type: force | ||
- match: { _id: "1" } | ||
|
||
- do: | ||
get: | ||
index: test_1 | ||
type: test | ||
id: 1 | ||
version: 1 | ||
version_type: force | ||
- match: { _id: "1" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
@bleskes I validate enum type params client side (no need to make the request) so this test fails.
Perhaps
catch: request
(the request should fail) orcatch: param
(there should be a param validation error) would be a better idea.