Skip to content

Commit

Permalink
Rename index names in 25_id_generation.yml file (#106558)
Browse files Browse the repository at this point in the history
Rename index names in yaml test to more easily find related log lines in
es server log. Many yaml tests are being executed in the same qa
cluster, this should help finding relevant logs for failures in this
yaml file.

Relates to #106550
  • Loading branch information
martijnvg committed Mar 20, 2024
1 parent 2523ed9 commit 52b311d
Showing 1 changed file with 52 additions and 92 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
setup:
- skip:
version: "- 8.12.99"
reason: _tsid hashing introduced in 8.13
version: "- 8.13.99"
reason: _tsid hashing introduced in 8.13 and tsid routing changed in 8.14

- do:
indices.create:
index: test
index: id_generation_test
body:
settings:
index:
Expand Down Expand Up @@ -44,7 +44,7 @@ setup:
- do:
bulk:
refresh: true
index: test
index: id_generation_test
body:
- '{"index": {}}'
- '{"@timestamp": "2021-04-28T18:50:04.467Z", "metricset": "pod", "k8s": {"pod": {"name": "cat", "uid":"947e4ced-1786-4e53-9e0c-5c447e959507", "ip": "10.10.55.1", "network": {"tx": 2001818691, "rx": 802133794}}}}'
Expand All @@ -65,14 +65,10 @@ setup:

---
generates a consistent id:
- skip:
version: " - 8.1.99"
reason: ID generation added in 8.2

- do:
bulk:
refresh: true
index: test
index: id_generation_test
body:
- '{"index": {}}'
- '{"@timestamp": "2021-04-28T18:52:04.467Z", "metricset": "pod", "k8s": {"pod": {"name": "cat", "uid":"947e4ced-1786-4e53-9e0c-5c447e959507", "ip": "10.10.55.1", "network": {"tx": 2001818691, "rx": 802133794}}}}'
Expand All @@ -81,15 +77,35 @@ generates a consistent id:
- do:
bulk:
refresh: true
index: test
index: id_generation_test
body:
- '{"index": {}}'
- '{"@timestamp": "2021-04-28T18:52:04.467Z", "metricset": "pod", "k8s": {"pod": {"name": "cat", "uid":"947e4ced-1786-4e53-9e0c-5c447e959507", "ip": "10.10.55.1", "network": {"tx": 2001818691, "rx": 802133794}}}}'
- match: {items.0.index._id: cZZNs7B9sSWsyrL5AAABeRnS7fM}

- do:
get:
index: id_generation_test
id: cn4excfoxSs_KdA5AAABeRnRFAY
- match: {_index: id_generation_test}
- match: {_id: cn4excfoxSs_KdA5AAABeRnRFAY}
- match:
_source:
"@timestamp": "2021-04-28T18:50:03.142Z"
metricset: pod
k8s:
pod:
name: dog
uid: df3145b3-0563-4d3b-a0f7-897eb2876ea9
ip: 10.10.55.3
network:
tx: 1434521831
rx: 530575198


- do:
search:
index: test
index: id_generation_test
body:
query:
match_all: {}
Expand Down Expand Up @@ -135,13 +151,9 @@ generates a consistent id:

---
index a new document on top of an old one:
- skip:
version: " - 8.12.99"
reason: _tsid hashing introduced in 8.13

- do:
search:
index: test
index: id_generation_test
body:
size: 0
aggs:
Expand All @@ -157,7 +169,7 @@ index a new document on top of an old one:
- do:
index:
refresh: true
index: test
index: id_generation_test
op_type: index
body:
"@timestamp": "2021-04-28T18:51:03.142Z"
Expand All @@ -174,7 +186,7 @@ index a new document on top of an old one:

- do:
search:
index: test
index: id_generation_test
body:
size: 0
aggs:
Expand All @@ -189,13 +201,9 @@ index a new document on top of an old one:

---
index a new document on top of an old one over bulk:
- skip:
version: " - 8.1.99"
reason: indexing on top of another document support added in 8.2

- do:
search:
index: test
index: id_generation_test
body:
size: 0
aggs:
Expand All @@ -211,15 +219,15 @@ index a new document on top of an old one over bulk:
- do:
bulk:
refresh: true
index: test
index: id_generation_test
body:
- '{"index": {}}'
- '{"@timestamp": "2021-04-28T18:51:03.142Z", "metricset": "pod", "k8s": {"pod": {"name": "dog", "uid":"df3145b3-0563-4d3b-a0f7-897eb2876ea9", "ip": "10.10.55.3", "network": {"tx": 111434595272, "rx": 430605511}}}}'
- match: {items.0.index._id: cn4excfoxSs_KdA5AAABeRnR_mY}

- do:
search:
index: test
index: id_generation_test
body:
size: 0
aggs:
Expand All @@ -234,15 +242,11 @@ index a new document on top of an old one over bulk:

---
create operation on top of old document fails:
- skip:
version: " - 8.1.99"
reason: id generation changed in 8.2

- do:
catch: "/\\[cn4excfoxSs_KdA5AAABeRnR_mY\\]\\[.*@2021-04-28T18:51:03.142Z\\]: version conflict, document already exists \\(current version \\[1\\]\\)/"
index:
refresh: true
index: test
index: id_generation_test
body:
"@timestamp": "2021-04-28T18:51:03.142Z"
metricset: pod
Expand All @@ -257,28 +261,20 @@ create operation on top of old document fails:

---
create operation on top of old document fails over bulk:
- skip:
version: " - 8.12.99"
reason: _tsid hashing introduced in 8.13

- do:
bulk:
refresh: true
index: test
index: id_generation_test
body:
- '{"create": {}}'
- '{"@timestamp": "2021-04-28T18:51:03.142Z", "metricset": "pod", "k8s": {"pod": {"name": "dog", "uid":"df3145b3-0563-4d3b-a0f7-897eb2876ea9", "ip": "10.10.55.3", "network": {"tx": 111434595272, "rx": 430605511}}}}'
- match: { items.0.create.error.reason: "[cn4excfoxSs_KdA5AAABeRnR_mY][KCjEJ9R_BgO8TRX2QOd6dpQ5ihHD--qoyLTiOy0pmP6_RAIE-e0-dKQ@2021-04-28T18:51:03.142Z]: version conflict, document already exists (current version [1])" }

---
ids query:
- skip:
version: " - 8.12.99"
reason: _tsid hashing introduced in 8.13

- do:
search:
index: test
index: id_generation_test
body:
fields:
- field: k8s.pod.network.tx
Expand All @@ -294,15 +290,11 @@ ids query:

---
get:
- skip:
version: " - 8.12.99"
reason: _tsid hashing introduced in 8.13

- do:
get:
index: test
index: id_generation_test
id: cZZNs7B9sSWsyrL5AAABeRnSA5M
- match: {_index: test}
- match: {_index: id_generation_test}
- match: {_id: cZZNs7B9sSWsyrL5AAABeRnSA5M}
- match:
_source:
Expand All @@ -319,107 +311,79 @@ get:

---
get not found:
- skip:
version: " - 8.1.99"
reason: ids generation changed in 8.2

- do:
catch: missing
get:
index: test
index: id_generation_test
id: not found

---
get with routing:
- skip:
version: " - 8.1.99"
reason: ids generation changed in 8.2

- do:
catch: bad_request
get:
index: test
index: id_generation_test
id: cZZNs-xII2fZweptAAABeRnSA5M
routing: routing

---
delete:
- skip:
version: " - 8.12.99"
reason: _tsid hashing introduced in 8.13

- do:
delete:
index: test
index: id_generation_test
id: cn4excfoxSs_KdA5AAABeRnR_mY
- match: {result: deleted}

---
delete not found:
- skip:
version: " - 8.1.99"
reason: ids generation changed in 8.2

- do:
catch: missing
delete:
index: test
index: id_generation_test
id: not found

---
delete with routing:
- skip:
version: " - 8.1.99"
reason: ids generation changed in 8.2

- do:
catch: bad_request
delete:
index: test
index: id_generation_test
id: not found
routing: routing

---
delete over _bulk:
- skip:
version: " - 8.1.99"
reason: ids generation changed in 8.2

# mget call added to investigate test failure: https://github.com/elastic/elasticsearch/issues/93852
# (should be removed when test issue is resolved)
- do:
mget:
index: test
index: id_generation_test
body:
ids: [ cn4excfoxSs_KdA5AAABeRnR_mY, cn4excfoxSs_KdA5AAABeRnR11Y ]
- match: { docs.0._index: "test" }
- match: { docs.0._index: "id_generation_test" }
- match: { docs.0._id: "cn4excfoxSs_KdA5AAABeRnR_mY" }
- match: { docs.0.found: true }
- match: { docs.1._index: "test" }
- match: { docs.1._index: "id_generation_test" }
- match: { docs.1._id: "cn4excfoxSs_KdA5AAABeRnR11Y" }
- match: { docs.1.found: true }

- do:
bulk:
index: test
index: id_generation_test
body:
- '{"delete": {"_id": "cn4excfoxSs_KdA5AAABeRnR_mY"}}'
- '{"delete": {"_id": "cn4excfoxSs_KdA5AAABeRnR11Y"}}'
- '{"delete": {"_id": "not found ++ not found"}}'
- match: {items.0.delete.result: deleted}
- match: {items.1.delete.result: deleted}
- match: {items.2.delete.status: 404}
- match: {items.2.delete.error.reason: "invalid id [not found ++ not found] for index [test] in time series mode"}
- match: {items.2.delete.error.reason: "invalid id [not found ++ not found] for index [id_generation_test] in time series mode"}

---
routing_path matches deep object:
- skip:
version: " - 8.12.99"
reason: _tsid hashing introduced in 8.13

- do:
indices.create:
index: test2
index: routing_path_test
body:
settings:
index:
Expand Down Expand Up @@ -449,7 +413,7 @@ routing_path matches deep object:
- do:
bulk:
refresh: true
index: test2
index: routing_path_test
body:
- '{"index": {}}'
- '{"@timestamp": "2021-04-28T18:50:04.467Z", "dim": {"foo": {"bar": {"baz": {"uid": "uid1"}}}}}'
Expand All @@ -458,13 +422,9 @@ routing_path matches deep object:

---
routing_path matches object:
- skip:
version: " - 8.12.99"
reason: _tsid hashing introduced in 8.13

- do:
indices.create:
index: test2
index: routing_path_test_2
body:
settings:
index:
Expand All @@ -490,7 +450,7 @@ routing_path matches object:
- do:
bulk:
refresh: true
index: test2
index: routing_path_test_2
body:
- '{"index": {}}'
- '{"@timestamp": "2021-04-28T18:50:04.467Z", "dim": {"foo": {"uid": "uid1"}}}'
Expand Down

0 comments on commit 52b311d

Please sign in to comment.