Skip to content

Set default index mode for TimeSeries to null #98586

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

Merged
merged 9 commits into from
Aug 23, 2023
Merged

Conversation

kkrik-es
Copy link
Contributor

@kkrik-es kkrik-es commented Aug 17, 2023

If the default index mode matches the specified, we skip printing the synthetic source info in mappings. This leads to confusion as it's not immediately visible (or well known) that time series indices use synthetic source by default.

Leaving the default index mode to null does the trick here. We do pass the right value for time series indexes while building the mapping so there's no other functional impact.

Fixes #97429

If the default index mode matches the specified, we skip printing the
synthetic source info in the mappings printing. This leads to confusion
as it's not immediately visible (or well known) that time series indices
use synthetic source by default.

Leaving the default index mode to null does the trick here. We do pass
the right value for time series indexes while building the mapping so
there's no functional impact here.

Fixes elastic#97429
@kkrik-es kkrik-es added >bug :Analytics/Aggregations Aggregations Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) labels Aug 17, 2023
@kkrik-es kkrik-es self-assigned this Aug 17, 2023
@elasticsearchmachine
Copy link
Collaborator

Hi @kkrik-es, I've created a changelog YAML for you.

@kkrik-es kkrik-es marked this pull request as ready for review August 17, 2023 14:19
@kkrik-es kkrik-es requested a review from martijnvg August 17, 2023 14:19
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo (Team:Analytics)

@kkrik-es
Copy link
Contributor Author

@elasticsearchmachine run elasticsearch-ci/bwc

@kkrik-es kkrik-es added v8.9.0 v8.8.3 v8.9.2 auto-backport Automatically create backport pull requests when merged and removed v8.9.0 labels Aug 21, 2023
Copy link
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

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

Left one comment about the assertion. Otherwise looks good.

* This got restored in v.8.9 (and patched in v.8.8) to avoid confusion. The change is only restricted to
* mapping printout, it has no functional effect as the synthetic source already applies.
*/
this.mappingSource = mapping.toCompressedXContent();
Copy link
Member

Choose a reason for hiding this comment

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

By doing this.mappingSource = mapping.toCompressedXContent(); we are changing the mapping source to contain the missing _source: mode: synthetic right?

If we would do this.mappingSource = source; here, then the that would remain to be missing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct. I was thinking of storing a source that matches this output to avoid surprises further down the processing pipeline, but up to you.

Copy link
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

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

LGTM

@kkrik-es kkrik-es merged commit 56abb86 into elastic:main Aug 23, 2023
kkrik-es added a commit to kkrik-es/elasticsearch that referenced this pull request Aug 23, 2023
* Default index mode null for TimeSeries

If the default index mode matches the specified, we skip printing the
synthetic source info in the mappings printing. This leads to confusion
as it's not immediately visible (or well known) that time series indices
use synthetic source by default.

Leaving the default index mode to null does the trick here. We do pass
the right value for time series indexes while building the mapping so
there's no functional impact here.

Fixes elastic#97429

* Update docs/changelog/98586.yaml

* Restore other error messages.

* Update source in DocumentMapper to include synthetic source.

* Add version check for skipping assert
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.10

elasticsearchmachine pushed a commit that referenced this pull request Aug 23, 2023
* Default index mode null for TimeSeries

If the default index mode matches the specified, we skip printing the
synthetic source info in the mappings printing. This leads to confusion
as it's not immediately visible (or well known) that time series indices
use synthetic source by default.

Leaving the default index mode to null does the trick here. We do pass
the right value for time series indexes while building the mapping so
there's no functional impact here.

Fixes #97429

* Update docs/changelog/98586.yaml

* Restore other error messages.

* Update source in DocumentMapper to include synthetic source.

* Add version check for skipping assert
@kkrik-es kkrik-es deleted the fix/97429 branch August 23, 2023 10:44
@kkrik-es kkrik-es restored the fix/97429 branch August 23, 2023 14:09
@kkrik-es kkrik-es deleted the fix/97429 branch August 23, 2023 14:11
@kkrik-es kkrik-es restored the fix/97429 branch August 23, 2023 14:16
kkrik-es added a commit to kkrik-es/elasticsearch that referenced this pull request Aug 23, 2023
kkrik-es added a commit that referenced this pull request Aug 23, 2023
* Skip segment for MatchNoDocsQuery filters.

When a query of a filter gets rewritten to MatchNoDocsQuery, segments
will not produce any results. We can therefore skip processing such
segments.

This applies to FilterByFilterAggregator and FiltersAggregator, as well
as to TermsAggregator when it uses StringTermsAggregatorFromFilters
internally; the latter is an adapter aggregator to
FilterByFilterAggregator.

Fixes #94637

* Update docs/changelog/98295.yaml

* Check all filters for `MatchNoDocsQuery`.

* Skip optimization when 'other' bucket is requested.

* Revert "Set default index mode for TimeSeries to `null` (#98586)"

This reverts commit 56abb86.
kkrik-es added a commit to kkrik-es/elasticsearch that referenced this pull request Aug 23, 2023
* Skip segment for MatchNoDocsQuery filters.

When a query of a filter gets rewritten to MatchNoDocsQuery, segments
will not produce any results. We can therefore skip processing such
segments.

This applies to FilterByFilterAggregator and FiltersAggregator, as well
as to TermsAggregator when it uses StringTermsAggregatorFromFilters
internally; the latter is an adapter aggregator to
FilterByFilterAggregator.

Fixes elastic#94637

* Update docs/changelog/98295.yaml

* Check all filters for `MatchNoDocsQuery`.

* Skip optimization when 'other' bucket is requested.

* Revert "Set default index mode for TimeSeries to `null` (elastic#98586)"

This reverts commit 56abb86.
elasticsearchmachine pushed a commit that referenced this pull request Aug 23, 2023
* Skip segment for MatchNoDocsQuery filters.

When a query of a filter gets rewritten to MatchNoDocsQuery, segments
will not produce any results. We can therefore skip processing such
segments.

This applies to FilterByFilterAggregator and FiltersAggregator, as well
as to TermsAggregator when it uses StringTermsAggregatorFromFilters
internally; the latter is an adapter aggregator to
FilterByFilterAggregator.

Fixes #94637

* Update docs/changelog/98295.yaml

* Check all filters for `MatchNoDocsQuery`.

* Skip optimization when 'other' bucket is requested.

* Revert "Set default index mode for TimeSeries to `null` (#98586)"

This reverts commit 56abb86.
kkrik-es added a commit to kkrik-es/elasticsearch that referenced this pull request Aug 23, 2023
kkrik-es added a commit that referenced this pull request Aug 25, 2023
* Skip segment for MatchNoDocsQuery filters.

When a query of a filter gets rewritten to MatchNoDocsQuery, segments
will not produce any results. We can therefore skip processing such
segments.

This applies to FilterByFilterAggregator and FiltersAggregator, as well
as to TermsAggregator when it uses StringTermsAggregatorFromFilters
internally; the latter is an adapter aggregator to
FilterByFilterAggregator.

Fixes #94637

* Update docs/changelog/98295.yaml

* Check all filters for `MatchNoDocsQuery`.

* Skip optimization when 'other' bucket is requested.

* Revert "Set default index mode for TimeSeries to `null` (#98586)"

This reverts commit 56abb86.

* Revert "Rollback of #98586 (#98805)"

This reverts commit e370194.

* Skip updating source when missing synthetic mode

* Update docs/changelog/98808.yaml

* Skip matching assert in MapperService too

* Refine the assert

* Extend versions before 8.6, when TS had no synthetic source

* Add source field mapping for non-synthetic TSDB

* Delete 98586.yaml

Duplicate changelog

* Add comment to TSDB_NO_SYNTHETIC mapping

* Spotless fix

* Add yaml test

* Fix version skip in yaml test
kkrik-es added a commit to kkrik-es/elasticsearch that referenced this pull request Aug 25, 2023
* Skip segment for MatchNoDocsQuery filters.

When a query of a filter gets rewritten to MatchNoDocsQuery, segments
will not produce any results. We can therefore skip processing such
segments.

This applies to FilterByFilterAggregator and FiltersAggregator, as well
as to TermsAggregator when it uses StringTermsAggregatorFromFilters
internally; the latter is an adapter aggregator to
FilterByFilterAggregator.

Fixes elastic#94637

* Update docs/changelog/98295.yaml

* Check all filters for `MatchNoDocsQuery`.

* Skip optimization when 'other' bucket is requested.

* Revert "Set default index mode for TimeSeries to `null` (elastic#98586)"

This reverts commit 56abb86.

* Revert "Rollback of elastic#98586 (elastic#98805)"

This reverts commit e370194.

* Skip updating source when missing synthetic mode

* Update docs/changelog/98808.yaml

* Skip matching assert in MapperService too

* Refine the assert

* Extend versions before 8.6, when TS had no synthetic source

* Add source field mapping for non-synthetic TSDB

* Delete 98586.yaml

Duplicate changelog

* Add comment to TSDB_NO_SYNTHETIC mapping

* Spotless fix

* Add yaml test

* Fix version skip in yaml test
elasticsearchmachine pushed a commit that referenced this pull request Aug 25, 2023
* Skip segment for MatchNoDocsQuery filters.

When a query of a filter gets rewritten to MatchNoDocsQuery, segments
will not produce any results. We can therefore skip processing such
segments.

This applies to FilterByFilterAggregator and FiltersAggregator, as well
as to TermsAggregator when it uses StringTermsAggregatorFromFilters
internally; the latter is an adapter aggregator to
FilterByFilterAggregator.

Fixes #94637

* Update docs/changelog/98295.yaml

* Check all filters for `MatchNoDocsQuery`.

* Skip optimization when 'other' bucket is requested.

* Revert "Set default index mode for TimeSeries to `null` (#98586)"

This reverts commit 56abb86.

* Revert "Rollback of #98586 (#98805)"

This reverts commit e370194.

* Skip updating source when missing synthetic mode

* Update docs/changelog/98808.yaml

* Skip matching assert in MapperService too

* Refine the assert

* Extend versions before 8.6, when TS had no synthetic source

* Add source field mapping for non-synthetic TSDB

* Delete 98586.yaml

Duplicate changelog

* Add comment to TSDB_NO_SYNTHETIC mapping

* Spotless fix

* Add yaml test

* Fix version skip in yaml test
bpintea pushed a commit to bpintea/elasticsearch that referenced this pull request Aug 25, 2023
* Skip segment for MatchNoDocsQuery filters.

When a query of a filter gets rewritten to MatchNoDocsQuery, segments
will not produce any results. We can therefore skip processing such
segments.

This applies to FilterByFilterAggregator and FiltersAggregator, as well
as to TermsAggregator when it uses StringTermsAggregatorFromFilters
internally; the latter is an adapter aggregator to
FilterByFilterAggregator.

Fixes elastic#94637

* Update docs/changelog/98295.yaml

* Check all filters for `MatchNoDocsQuery`.

* Skip optimization when 'other' bucket is requested.

* Revert "Set default index mode for TimeSeries to `null` (elastic#98586)"

This reverts commit 56abb86.

* Revert "Rollback of elastic#98586 (elastic#98805)"

This reverts commit e370194.

* Skip updating source when missing synthetic mode

* Update docs/changelog/98808.yaml

* Skip matching assert in MapperService too

* Refine the assert

* Extend versions before 8.6, when TS had no synthetic source

* Add source field mapping for non-synthetic TSDB

* Delete 98586.yaml

Duplicate changelog

* Add comment to TSDB_NO_SYNTHETIC mapping

* Spotless fix

* Add yaml test

* Fix version skip in yaml test
@JVerwolf JVerwolf added v8.10.0 and removed v8.10.1 labels Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/Aggregations Aggregations auto-backport Automatically create backport pull requests when merged >bug Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v8.10.0 v8.11.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Synthetic source is on by default for TSDS but does not appear in mappings
4 participants