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 over non-existent index name with wildcard returns incorrect scroll_id #85709

Closed
gregolsen opened this issue Apr 5, 2022 · 4 comments
Closed
Labels
>bug :Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team

Comments

@gregolsen
Copy link

Elasticsearch Version

7.17.1

Installed Plugins

No response

Java Version

bundled

OS Version

Problem Description

On 7.17.0 running a search query where index name is a wildcard that doesn't match any indices returns payload without scroll_id:

GET /non_existent*/_search?scroll=1m&size=10

{
  "took" : 0,
  "timed_out" : false,
  "_shards" : {
    "total" : 0,
    "successful" : 0,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 0,
      "relation" : "eq"
    },
    "max_score" : 0.0,
    "hits" : [ ]
  }
}

On 7.17.1 running the same query returns scroll_id:

GET /non_existent*/_search?scroll=1m&size=10

{
  "_scroll_id" : "FGluY2x1ZGVfY29udGV4dF91dWlkDnF1ZXJ5VGhlbkZldGNoAA==",
  "took" : 0,
  "timed_out" : false,
  "_shards" : {
    "total" : 0,
    "successful" : 0,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 0,
      "relation" : "eq"
    },
    "max_score" : 0.0,
    "hits" : [ ]
  }
}

Returning scroll_id is misleading – if the client attempts to fetch next page exception is thrown:

GET /_search/scroll?scroll_id=FGluY2x1ZGVfY29udGV4dF91dWlkDnF1ZXJ5VGhlbkZldGNoAA==

{
  "error" : {
    "root_cause" : [ ],
    "type" : "search_phase_execution_exception",
    "reason" : "no nodes to search on",
    "phase" : "query",
    "grouped" : true,
    "failed_shards" : [ ]
  },
  "status" : 503
}

This scroll_id is always the same. Its decoded value is \x14include_context_uuid\x0EqueryThenFetch\x00 – just the header of the real scroll id. But there's no shards to search over – hence the exception on fetching the next page.

Steps to Reproduce

Running GET /non_existent*/_search?scroll=1m&size=10 should not return scroll_id as part of the payload as it was in 7.17.0.

Logs (if relevant)

No response

@gregolsen gregolsen added >bug needs:triage Requires assignment of a team area label labels Apr 5, 2022
@dnhatn
Copy link
Member

dnhatn commented Apr 6, 2022

This is related to #83424.

@dnhatn dnhatn added :Search/Search Search-related issues that do not fall into other categories and removed needs:triage Requires assignment of a team area label labels Apr 6, 2022
@elasticmachine elasticmachine added the Team:Search Meta label for search team label Apr 6, 2022
@elasticmachine
Copy link
Collaborator

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

@javanna
Copy link
Member

javanna commented Apr 19, 2022

@dnhatn does this mean that what is described is now the expected behaviour? Any follow-up needed or can we close this issue?

@benwtrent
Copy link
Member

This is expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team
Projects
None yet
Development

No branches or pull requests

5 participants