-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Add timeout to synonyms put APIs to wait for synonyms system index to be searchable #126314
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
Closed
carlosdelest
wants to merge
22
commits into
elastic:main
from
carlosdelest:bugfix/synonyms-index-searchable
Closed
Changes from 17 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
dafbf90
Add timeout to SynonymsManagementAPIService put synonyms
carlosdelest a5a8a75
Remove replicas 0, as that may impact serverless
carlosdelest 6e57ae3
Add timeout to put synonyms action, fix tests
carlosdelest 7dee4b5
Fix number of replicas
carlosdelest 19b5c33
Remove cluster.health checks for synonyms index
carlosdelest fcf4dc6
Revert debugging
carlosdelest 51f67eb
Add integration test for timeouts
carlosdelest ab0805d
Use TimeValue instead of an int
carlosdelest 3b8bbfd
Add YAML tests and REST API specs
carlosdelest 8da7611
Fix a validation bug in put synonym rule
carlosdelest 4ab01af
Spotless
carlosdelest 6245d57
Update docs/changelog/126314.yaml
carlosdelest baca84c
Remove unnecessary checks for null
carlosdelest fbe393f
Fix equals / HashCode
carlosdelest a3dca50
Checks that timeout is passed correctly to the check health method
carlosdelest 1ecfb12
Use correctly the default timeout
carlosdelest b419e4c
spotless
carlosdelest eaeaaf7
Add monitor cluster privilege to internal synonyms user
carlosdelest 8fef96c
[CI] Auto commit changes from spotless
8d3e221
Add capabilities to avoid failing on bwc tests
carlosdelest 0044e80
Merge remote-tracking branch 'carlosdelest/bugfix/synonyms-index-sear…
carlosdelest 733aa81
[CI] Auto commit changes from spotless
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,6 @@ | ||
| pr: 126314 | ||
| summary: Add timeout to synonyms put APIs to wait for synonyms to be accessible | ||
| area: Analysis | ||
| type: bug | ||
| issues: | ||
| - 121441 |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -14,12 +14,6 @@ setup: | |
| - synonyms: "test => check" | ||
| id: "test-id-3" | ||
|
|
||
| # 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 | ||
| wait_for_status: green | ||
|
|
||
| --- | ||
| "Update a synonyms rule": | ||
| - do: | ||
|
|
@@ -85,3 +79,69 @@ setup: | |
| rule_id: "test-id-0" | ||
| body: | ||
| synonyms: "i-phone, iphone" | ||
|
|
||
| --- | ||
| "Timeout can be specified": | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These general validation tests were missing - adding them and the timeout validation tests |
||
| - do: | ||
| synonyms.put_synonym_rule: | ||
| set_id: "test-synonyms" | ||
| rule_id: "test-id-0" | ||
| timeout: 10s | ||
| body: | ||
| synonyms: "i-phone, iphone" | ||
|
|
||
| - match: { result: "created" } | ||
| - match: { reload_analyzers_details._shards.total: 0 } | ||
| - length: { reload_analyzers_details.reload_details: 0 } | ||
|
|
||
| --- | ||
| "Validation failure tests": | ||
| - do: | ||
| catch: /\[synonyms\] field can't be empty/ | ||
| synonyms.put_synonym_rule: | ||
| set_id: "test-synonyms" | ||
| rule_id: "test-id-0" | ||
| body: | ||
| synonyms: "" | ||
|
|
||
| - do: | ||
| catch: /More than one explicit mapping specified in the same synonyms rule/ | ||
| synonyms.put_synonym_rule: | ||
| set_id: "test-synonyms" | ||
| rule_id: "test-id-0" | ||
| body: | ||
| synonyms: "bye => => goodbye" | ||
|
|
||
| - do: | ||
| catch: /Incorrect syntax for \[synonyms\]/ | ||
| synonyms.put_synonym_rule: | ||
| set_id: "test-synonyms" | ||
| rule_id: "test-id-0" | ||
| body: | ||
| synonyms: " => goodbye" | ||
|
|
||
| - do: | ||
| catch: /Incorrect syntax for \[synonyms\]/ | ||
| synonyms.put_synonym_rule: | ||
| set_id: "test-synonyms" | ||
| rule_id: "test-id-0" | ||
| body: | ||
| synonyms: "bye => " | ||
|
|
||
| - do: | ||
| catch: /Incorrect syntax for \[synonyms\]/ | ||
| synonyms.put_synonym_rule: | ||
| set_id: "test-synonyms" | ||
| rule_id: "test-id-0" | ||
| body: | ||
| synonyms: "bye, goodbye, " | ||
|
|
||
| - do: | ||
| catch: /as a time value:\ negative durations are not supported/ | ||
| synonyms.put_synonym_rule: | ||
| set_id: "test-synonyms" | ||
| rule_id: "test-id-0" | ||
| timeout: -100s | ||
| body: | ||
| synonyms_set: | ||
| - synonyms: "bye, goodbye" | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We no longer need to do an explicit wait in tests, as it is done in the PUT operations themselves