Skip to content
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

Search during index create #66853

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

henningandersen
Copy link
Contributor

When creating an index, the primary will be either unassigned or
initializing for a short while. This causes issues when concurrent
processes does searches hitting those indices, either explicitly,
through patterns, aliases or data streams. This commit changes the
behavior to disregard shards where the primary is inactive due to
having just been created.

Closes #65846

When creating an index, the primary will be either unassigned or
initializing for a short while. This causes issues when concurrent
processes does searches hitting those indices, either explicitly,
through patterns, aliases or data streams. This commit changes the
behavior to disregard shards where the primary is inactive due to
having just been created.

Closes elastic#65846
@henningandersen henningandersen added >enhancement :Search/Search Search-related issues that do not fall into other categories v8.0.0 v7.12.0 labels Dec 29, 2020
@elasticmachine elasticmachine added the Team:Search Meta label for search team label Dec 29, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (Team:Search)

@henningandersen
Copy link
Contributor Author

There is an edge case that needs handling before this can be reviewed. Sorry for the noise.

@elasticsearchmachine
Copy link
Collaborator

Hi @henningandersen, I've created a changelog YAML for you.

@javanna
Copy link
Member

javanna commented Feb 9, 2022

hi @henningandersen should we close this?

@droberts195
Copy link
Contributor

should we close this?

Certainly the issue it was trying to fix, #65846, is still a problem that needs resolving somehow.

There is an edge case that needs handling before this can be reviewed

If that edge case is so difficult to fix that this whole change has to be scrapped then it would at least be good to write what it is on the issue so that any future attempts can try to avoid it.

@csoulios csoulios added v8.6.0 and removed v8.5.0 labels Sep 21, 2022
@kingherc kingherc added v8.7.0 and removed v8.6.0 labels Nov 16, 2022
@rjernst rjernst added v8.8.0 and removed v8.7.0 labels Feb 8, 2023
@gmarouli gmarouli added v8.9.0 and removed v8.8.0 labels Apr 26, 2023
@quux00 quux00 added v8.11.0 and removed v8.10.0 labels Aug 16, 2023
@mattc58 mattc58 added v8.12.0 and removed v8.11.0 labels Oct 4, 2023
@droberts195
Copy link
Contributor

There is an edge case that needs handling before this can be reviewed.

What was the edge case?

The non-test code changes in this PR are very small, so it's a shame if this fix is completely blocked.

I am wondering if internal clients could be allowed to opt to ignore the edge case if it is not too bad, or if we're careful where we opt to ignore it. That could be done using a request parameter that's not exposed on the REST layer so that it's limited to internal use cases.

@henningandersen
Copy link
Contributor Author

Thanks for bringing this up again David. The edge case is something like this:

  1. A user creates an index without waiting for it to be green/yellow (or there could be an edge case with waiting too).
  2. A user indexes data and refreshes it against the shard, before all nodes knows it is started.
  3. A user searches the index, unluckily hitting a node that does not know the shard is started yet. The search returns without the data indexed in step 2.

It will be a rare edge case. I need to double check some things to see if it can also happen if we wait for yellow.

@maxhniebergall
Copy link
Member

Hi team, is there any chance that this PR can get tested and merged?

@javanna javanna added :Distributed/Distributed A catch all label for anything in the Distributed Area. If you aren't sure, use this one. Team:Distributed Meta label for distributed team and removed :Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team v8.15.0 labels Jun 18, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (Team:Distributed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed/Distributed A catch all label for anything in the Distributed Area. If you aren't sure, use this one. >enhancement Team:Distributed Meta label for distributed team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow Ignoring failures for indices that have just been created