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

[Rollup] Proactively resolve index patterns in RollupSearch endoint #34930

Merged

Conversation

polyfractal
Copy link
Contributor

This changes the RollupSearch endpoint to proactively resolve index patterns.

Today, we assume any index that doesn't have a rollup cap to be a raw/live index. But if the user specifies a wildcard pattern on a rollup index (rollup-foo*), this causes a problem. We can't find an index that matches the exact string "rollup-foo*" so we assume it is a live index and pass it off to the regular Search endpoint. Search resolves that to the rollup index, searches it but gets no hits because none of the names match. The result is an empty search response that doesn't make sense to the user.

Instead, we should resolve index patterns up front in the RollupSearch endpoint. If the index pattern(s) match more than one rollup index, an exception is thrown just like before. But if the pattern only matches one rollup index, execution is allowed to continue.

Regular indices continue to function as before, the only difference is that we resolve the pattern and search with a list instead of the pattern (e.g. search for logstash-1,logstash-2,logstash-3 instead of logstash-*).

Also tweaks the documentation to make this clear.

Closes #34828

Kibana has requested this as blocker for 6.5. The change is pretty minimal and should be safe I think. I don't think it would be the end of the world if it slipped to 6.5.1 though.

This changes the RollupSearch endpoint to proactively resolve index
patterns.  If the index pattern(s) match more than one rollup index,
an exception is throw as before.  But if the pattern only matches one
rollup index, execution is allowed to continue (unlike before where
it would assume all patterns were for raw data).

Also tweaks the documentation to make this clear.

Closes elastic#34828
@polyfractal polyfractal added >bug v7.0.0 :StorageEngine/Rollup Turn fine-grained time-based data into coarser-grained data v6.5.0 v6.6.0 labels Oct 26, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search-aggs

Copy link
Contributor

@jimczi jimczi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a small comment regarding the tests with alias, LGTM otherwise

}
return new RollupSearchContext(normal.toArray(new String[normal.size()]), rollup.toArray(new String[rollup.size()]), jobCaps);
return new RollupSearchContext(normal.toArray(new String[0]), rollup.toArray(new String[0]), jobCaps);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reminds me a recent email ;)

@polyfractal polyfractal merged commit f9dd33a into elastic:master Oct 30, 2018
polyfractal added a commit that referenced this pull request Oct 30, 2018
…34930)

This changes the RollupSearch endpoint to proactively resolve index
patterns.  If the index pattern(s) match more than one rollup index,
an exception is throw as before.  But if the pattern only matches one
rollup index, execution is allowed to continue (unlike before where
it would assume all patterns were for raw data).

This also allows the search endpoint to resolve aliases that point to
a rollup index.

Also tweaks the documentation to make this clear.

Closes #34828
polyfractal added a commit that referenced this pull request Oct 30, 2018
…34930)

This changes the RollupSearch endpoint to proactively resolve index
patterns.  If the index pattern(s) match more than one rollup index,
an exception is throw as before.  But if the pattern only matches one
rollup index, execution is allowed to continue (unlike before where
it would assume all patterns were for raw data).

This also allows the search endpoint to resolve aliases that point to
a rollup index.

Also tweaks the documentation to make this clear.

Closes #34828
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :StorageEngine/Rollup Turn fine-grained time-based data into coarser-grained data v6.5.0 v6.6.0 v7.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rollup search endpoint fails on wildcard index pattern
4 participants