forked from opensearch-project/OpenSearch
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
if_seq_no
and if_primary_term
parameters aren't wired correctly i…
…n REST Client's CRUD API (#38411)
- Loading branch information
Showing
6 changed files
with
142 additions
and
13 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
42 changes: 42 additions & 0 deletions
42
rest-api-spec/src/main/resources/rest-api-spec/test/bulk/80_cas.yml
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,42 @@ | ||
--- | ||
"Compare And Swap Sequence Numbers": | ||
|
||
- skip: | ||
version: " - 6.99.99" | ||
reason: typeless API are add in 7.0.0 | ||
|
||
- do: | ||
index: | ||
index: test_1 | ||
id: 1 | ||
body: { foo: bar } | ||
- match: { _version: 1} | ||
- set: { _seq_no: seqno } | ||
- set: { _primary_term: primary_term } | ||
|
||
- do: | ||
bulk: | ||
body: | ||
- index: | ||
_index: test_1 | ||
_id: 1 | ||
if_seq_no: 10000 | ||
if_primary_term: $primary_term | ||
- foo: bar2 | ||
|
||
- match: { errors: true } | ||
- match: { items.0.index.status: 409 } | ||
- match: { items.0.index.error.type: version_conflict_engine_exception } | ||
|
||
- do: | ||
bulk: | ||
body: | ||
- index: | ||
_index: test_1 | ||
_id: 1 | ||
if_seq_no: $seqno | ||
if_primary_term: $primary_term | ||
- foo: bar2 | ||
|
||
- match: { errors: false} | ||
- match: { items.0.index.status: 200 } |
45 changes: 45 additions & 0 deletions
45
rest-api-spec/src/main/resources/rest-api-spec/test/bulk/81_cas_with_types.yml
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,45 @@ | ||
--- | ||
"Compare And Swap Sequence Numbers": | ||
|
||
- skip: | ||
version: " - 6.6.99" | ||
reason: cas operations with sequence numbers was added in 6.7 | ||
|
||
- do: | ||
index: | ||
index: test_1 | ||
type: _doc | ||
id: 1 | ||
body: { foo: bar } | ||
- match: { _version: 1} | ||
- set: { _seq_no: seqno } | ||
- set: { _primary_term: primary_term } | ||
|
||
- do: | ||
bulk: | ||
body: | ||
- index: | ||
_index: test_1 | ||
_type: _doc | ||
_id: 1 | ||
if_seq_no: 10000 | ||
if_primary_term: $primary_term | ||
- foo: bar2 | ||
|
||
- match: { errors: true } | ||
- match: { items.0.index.status: 409 } | ||
- match: { items.0.index.error.type: version_conflict_engine_exception } | ||
|
||
- do: | ||
bulk: | ||
body: | ||
- index: | ||
_index: test_1 | ||
_type: _doc | ||
_id: 1 | ||
if_seq_no: $seqno | ||
if_primary_term: $primary_term | ||
- foo: bar2 | ||
|
||
- match: { errors: false} | ||
- match: { items.0.index.status: 200 } |
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