-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Conversation
Pinging @elastic/es-search (Team:Search) |
@elasticmachine run elasticsearch-ci/bwc |
if (indexSettings.getIndexVersionCreated().isLegacyIndexVersion() | ||
&& indexSettings.getIndexMetadata().isSearchableSnapshot() == false) { | ||
return Optional.of( | ||
engineConfig -> new ReadOnlyEngine( |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks Yannick.
Thanks @dnhatn! |
There was a problem hiding this 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!)
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).