-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Synonyms API - Ensure system index is available when updating synonyms #121441
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
Comments
Pinging @elastic/es-search-relevance (Team:Search Relevance) |
Draft PR: #126314 |
@carlosdelest this does feel like two parameters. I don't think I think we need two parameters:
I think its valid for:
Also for Also for What do you think? |
I have a couple of points:
|
@benwtrent @mayya-sharipova thanks for your comments! I agree that a timeout can be confusing from a user perspective - I was exposing the cluster health API timeout directly and that might not be the best way forward with this. In my mind, we want that check to happen by default, and users may want to skip it in case there's some availability problem with the synonyms index. That should be a temporary issue, as a new replica should be created (in serverless or stateful).
That way, when That looks aligned with other users of WDYT? |
That's something we can do, although I wonder if there are some other possibilities for the index to become yellow that we would miss that way.
It's quite short, but we need to read from the master for this one. We always want to make this check if possible for the reasons mentioned above, and may want to skip that if there is some kind of synonyms index availability problem or if users want to perform reloading analyzers themselves. |
@carlosdelest I thought about it more, and I want to clarify something with you. From your experience, would not wait_for_active_shards=all be a better option? Would this approach be better:
|
We discussed this offline, and agreed on:
|
Description
When the synonyms system index is first created via the first update via the Synonyms API, there's the possibility that the operation returns before the index is ready for search.
For example, in serverless it's possible that read shards have not been replicated yet from the index shards. That can cause an error if the Synonyms API is invoked afterwards, as there would be no read shards available and thus the request would fail.
It would be good to check that the synonyms index is readable before returning to the user when an update operation is requested. That way, ES can do some timed wait on the index being available when it receives back a 503.
We could put this as a separate option similar to
wait_for_completion
, although that could be misleading - the Synonyms API already waits for the analyzers to be reloaded. As this is an API that is not expecting heavy updates, it could be enough with waiting for a default (or configurable) timeout when an update happens to ensure the synonyms system index is searchable.Related - #121180
The text was updated successfully, but these errors were encountered: