Skip to content

Commit

Permalink
Add logging and shard allocation explain
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosdelest committed Oct 18, 2024
1 parent a3369ef commit 7f7a4af
Show file tree
Hide file tree
Showing 10 changed files with 227 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,6 @@ setup:

- match: { result: "created" }

# This is to ensure that at least two index shards (write and read) are available. In serverless this can take some time.
- do:
cluster.health:
index: .synonyms-2
level: shards
wait_for_status: green
timeout: 2m

- do:
synonyms.get_synonym:
id: test-update-synonyms

- is_true: synonyms_set.0.id
- is_true: synonyms_set.1.id

Expand Down Expand Up @@ -71,7 +59,7 @@ setup:
index: .synonyms-2
level: shards
wait_for_status: green
timeout: 2m
timeout: 30s

- do:
synonyms.get_synonym:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@ setup:
- requires:
cluster_features: ["gte_v8.16.0"]
reason: Lenient handling of updateable synonyms by default is introduced in 8.16.0

- do:
cluster.put_settings:
body:
persistent:
logger.org.elasticsearch: DEBUG
---
teardown:
- do:
cluster.put_settings:
body:
persistent:
logger.org.elasticsearch: INFO
---
"Load index with an invalid synonym rule":
- do:
Expand All @@ -11,13 +24,26 @@ setup:
synonyms_set:
synonyms: "foo => bar, baz"

# This is to ensure that at least two index shards (write and read) are available. In serverless this can take some time.
# This is to ensure that all index shards (write and read) are available. In serverless this can take some time.
- do:
cluster.health:
index: .synonyms-2
level: shards
timeout: 60s
wait_for_status: green
ignore: 408

- do:
cluster.allocation_explain:
body: { "index": ".synonyms-2", "shard": 0, "primary": false }
ignore: 400

- do:
cluster.health:
index: .synonyms-2
level: shards
timeout: 20s
wait_for_status: green
timeout: 2m

- do:
indices.create:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ setup:
- requires:
cluster_features: ["gte_v8.10.0"]
reason: Introduced in 8.10.0

- do:
cluster.put_settings:
body:
persistent:
logger.org.elasticsearch: DEBUG

- do:
synonyms.put_synonym:
id: test-get-synonyms
Expand All @@ -14,13 +21,26 @@ setup:
- synonyms: "test => check"
id: "test-id-3"

# This is to ensure that at least two index shards (write and read) are available. In serverless this can take some time.
# This is to ensure that all index shards (write and read) are available. In serverless this can take some time.
- do:
cluster.health:
index: .synonyms-2
level: shards
timeout: 60s
wait_for_status: green
ignore: 408

- do:
cluster.allocation_explain:
body: { "index": ".synonyms-2", "shard": 0, "primary": false }
ignore: 400

- do:
cluster.health:
index: .synonyms-2
level: shards
timeout: 20s
wait_for_status: green
timeout: 2m

---
"Get synonyms set":
Expand All @@ -38,7 +58,13 @@ setup:
id: "test-id-2"
- synonyms: "test => check"
id: "test-id-3"

---
teardown:
- do:
cluster.put_settings:
body:
persistent:
logger.org.elasticsearch: INFO
---
"Get synonyms set - not found":
- do:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ setup:
- requires:
cluster_features: ["gte_v8.10.0"]
reason: Introduced in 8.10.0

- do:
cluster.put_settings:
body:
persistent:
logger.org.elasticsearch: DEBUG

- do:
synonyms.put_synonym:
id: test-get-synonyms
Expand All @@ -12,14 +19,33 @@ setup:
- synonyms: "bye => goodbye"
id: "test-id-2"

# This is to ensure that at least two index shards (write and read) are available. In serverless this can take some time.
# This is to ensure that all index shards (write and read) are available. In serverless this can take some time.
- do:
cluster.health:
index: .synonyms-2
level: shards
timeout: 60s
wait_for_status: green
timeout: 2m
ignore: 408

- do:
cluster.allocation_explain:
body: { "index": ".synonyms-2", "shard": 0, "primary": false }
ignore: 400

- do:
cluster.health:
index: .synonyms-2
level: shards
timeout: 20s
wait_for_status: green
---
teardown:
- do:
cluster.put_settings:
body:
persistent:
logger.org.elasticsearch: INFO
---
"Delete synonyms set":
- do:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ setup:
- requires:
cluster_features: ["gte_v8.10.0"]
reason: Introduced in 8.10.0

- do:
cluster.put_settings:
body:
persistent:
logger.org.elasticsearch: DEBUG

- do:
synonyms.put_synonym:
id: test-synonyms-3
Expand All @@ -10,13 +17,26 @@ setup:
- synonyms: "hello, hi"
- synonyms: "goodbye, bye"

# This is to ensure that at least two index shards (write and read) are available. In serverless this can take some time.
# This is to ensure that all index shards (write and read) are available. In serverless this can take some time.
- do:
cluster.health:
index: .synonyms-2
level: shards
timeout: 60s
wait_for_status: green
ignore: 408

- do:
cluster.allocation_explain:
body: { "index": ".synonyms-2", "shard": 0, "primary": false }
ignore: 400

- do:
cluster.health:
index: .synonyms-2
level: shards
timeout: 20s
wait_for_status: green
timeout: 2m

- do:
synonyms.put_synonym:
Expand Down Expand Up @@ -44,7 +64,7 @@ setup:
cluster.health:
index: .synonyms-2
level: shards
timeout: 2m
timeout: 30s
wait_for_status: green


Expand All @@ -54,7 +74,7 @@ teardown:
cluster.put_settings:
body:
persistent:
logger.org.elasticsearch.synonyms: null
logger.org.elasticsearch: INFO
---
"List synonyms set":
- do:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ setup:
- requires:
cluster_features: ["gte_v8.10.0"]
reason: Introduced in 8.10.0

- do:
cluster.put_settings:
body:
persistent:
logger.org.elasticsearch: DEBUG

- do:
synonyms.put_synonym:
id: test-synonyms
Expand All @@ -14,14 +21,33 @@ setup:
- synonyms: "test => check"
id: "test-id-3"

# This is to ensure that at least two index shards (write and read) are available. In serverless this can take some time.
# This is to ensure that all index shards (write and read) are available. In serverless this can take some time.
- do:
cluster.health:
index: .synonyms-2
level: shards
timeout: 60s
wait_for_status: green
timeout: 2m
ignore: 408

- do:
cluster.allocation_explain:
body: { "index": ".synonyms-2", "shard": 0, "primary": false }
ignore: 400

- do:
cluster.health:
index: .synonyms-2
level: shards
timeout: 20s
wait_for_status: green
---
teardown:
- do:
cluster.put_settings:
body:
persistent:
logger.org.elasticsearch: INFO
---
"Update a synonyms rule":
- do:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ setup:
- requires:
cluster_features: ["gte_v8.10.0"]
reason: Introduced in 8.10.0

- do:
cluster.put_settings:
body:
persistent:
logger.org.elasticsearch: DEBUG

- do:
synonyms.put_synonym:
id: test-synonyms
Expand All @@ -14,12 +21,6 @@ setup:
- synonyms: "test => check"
id: "test-id-3"

- do:
cluster.put_settings:
body:
persistent:
logger.org.elasticsearch: DEBUG

# This is to ensure that all index shards (write and read) are available. In serverless this can take some time.
- do:
cluster.health:
Expand All @@ -32,6 +33,7 @@ setup:
- do:
cluster.allocation_explain:
body: { "index": ".synonyms-2", "shard": 0, "primary": false }
ignore: 400

- do:
cluster.health:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ setup:
- requires:
cluster_features: ["gte_v8.10.0"]
reason: Introduced in 8.10.0
- do:
cluster.put_settings:
body:
persistent:
logger.org.elasticsearch: DEBUG
- do:
synonyms.put_synonym:
id: test-synonyms
Expand All @@ -14,13 +19,26 @@ setup:
- synonyms: "test => check"
id: "test-id-3"

# This is to ensure that at least two index shards (write and read) are available. In serverless this can take some time.
# This is to ensure that all index shards (write and read) are available. In serverless this can take some time.
- do:
cluster.health:
index: .synonyms-2
level: shards
timeout: 60s
wait_for_status: green
ignore: 408

- do:
cluster.allocation_explain:
body: { "index": ".synonyms-2", "shard": 0, "primary": false }
ignore: 400

- do:
cluster.health:
index: .synonyms-2
level: shards
timeout: 20s
wait_for_status: green
timeout: 2m


---
Expand Down Expand Up @@ -52,6 +70,13 @@ setup:
id: "test-id-1"
- synonyms: "test => check"
id: "test-id-3"
---
teardown:
- do:
cluster.put_settings:
body:
persistent:
logger.org.elasticsearch: INFO

---
"Delete synonym rule - missing synonym set":
Expand Down
Loading

0 comments on commit 7f7a4af

Please sign in to comment.