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

Add points metadata support for archive indices #86655

Merged
merged 7 commits into from
May 16, 2022

Conversation

ywelsch
Copy link
Contributor

@ywelsch ywelsch commented May 11, 2022

Archive indices appear just as regular indices in a cluster, and can be part of index patterns when queried. To allow searches to quickly skip shards of archive indices that might not have relevant data, we're adding support for skipping shards of archive indices here that don't have data falling in the time range being queried. This is critical for the Kibana experience which relies on the date range picker to quickly skip some of the indices in an index pattern.

Doing the actual time-range query on the archive index is much more expensive as on a regular index (as it's using doc-values instead of points to run the query, equating to a full scan of the columnar data). The solution here is to make points metadata available in archive indices, so that the minimum and maximum value can be retrieved in constant time (only a tiny fraction of the full points capabilities).

@ywelsch ywelsch added >non-issue :Search/Search Search-related issues that do not fall into other categories v8.3.0 labels May 11, 2022
@elasticmachine elasticmachine added the Team:Search Meta label for search team label May 11, 2022
@elasticmachine
Copy link
Collaborator

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

@ywelsch ywelsch mentioned this pull request May 11, 2022
32 tasks
@ywelsch
Copy link
Contributor Author

ywelsch commented May 11, 2022

@elasticmachine run elasticsearch-ci/bwc

if (indexSettings.getIndexVersionCreated().isLegacyIndexVersion()
&& indexSettings.getIndexMetadata().isSearchableSnapshot() == false) {
return Optional.of(
engineConfig -> new ReadOnlyEngine(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Archive indices had already been read-only (enforced by write block that can't be removed). We're using ReadOnlyEngine here now that leverages some of the advantages of statically knowing that the index is read only. In particular, it fixes an issue where points are being used by peer recovery, which ReadOnly nicely sidesteps by making the document-based recovery a NOOP.

@ywelsch ywelsch requested review from dnhatn and jpountz May 11, 2022 11:17
Copy link
Member

@dnhatn dnhatn left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks Yannick.

@ywelsch ywelsch merged commit 8a58e36 into elastic:master May 16, 2022
@ywelsch
Copy link
Contributor Author

ywelsch commented May 16, 2022

Thanks @dnhatn!

Copy link
Contributor

@jpountz jpountz left a comment

Choose a reason for hiding this comment

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

LGTM too. (Sorry for being late to the party!)

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

Successfully merging this pull request may close these issues.

4 participants