Skip to content

synthetic source index setting provider should check source field mapper #113522

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

Conversation

martijnvg
Copy link
Member

@martijnvg martijnvg commented Sep 25, 2024

Adds logic to SyntheticSourceIndexSettingsProvider to check source field mapper to whether synthetic source is enabled.

Before this change the SyntheticSourceIndexSettingsProvider would only check the index.mode setting, which doesn't cover all usages of synthtic source.

…eld mapper to whether synthetic source is enabled.

Before this change the SyntheticSourceIndexSettingsProvider would only check the index.mode setting, which doesn't cover all usages of synthtic source.
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-storage-engine (Team:StorageEngine)

var rawIndexMode = indexTemplateAndCreateRequestSettings.get(IndexSettings.MODE.getKey());
IndexMode indexMode = rawIndexMode != null ? Enum.valueOf(IndexMode.class, rawIndexMode.toUpperCase(Locale.ROOT)) : null;
return indexMode != null && indexMode.isSyntheticSourceEnabled();
boolean newIndexHasSyntheticSourceUsage(
Copy link
Member Author

Choose a reason for hiding this comment

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

this is the core of the change: instead of checking the index.mode setting, this now uses SourceFieldMapper#isSynthetic() to determine synthetic source usage..

@martijnvg martijnvg changed the title SyntheticSourceIndexSettingsProvider should check source field mapper synthetic source index setting provider should check source field mapper Sep 25, 2024
}

tmpIndexMetadata.settings(finalResolvedSettings);
// Create MapperService just to extract keyword dimension fields:
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand this comment...I don't see we are extracting dimensions...

Copy link
Member Author

Choose a reason for hiding this comment

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

that comment makes no sense in this context, I copied it initially from DataStreamIndexSettingsProvider. I will update this.


var tmpIndexMetadata = IndexMetadata.builder(indexName);

int dummyPartitionSize = IndexMetadata.INDEX_ROUTING_PARTITION_SIZE_SETTING.get(indexTemplateAndCreateRequestSettings);
Copy link
Contributor

Choose a reason for hiding this comment

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

I would probably create a method like buildDummySettingsForMerge just to extract this logic and explain (maybe in Javadoc)that we do this just as a way to create aMapperService

Copy link
Member Author

Choose a reason for hiding this comment

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

👍 makes sense

@martijnvg martijnvg merged commit 0cdcc8c into elastic:main Sep 27, 2024
15 checks passed
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.x

martijnvg added a commit to martijnvg/elasticsearch that referenced this pull request Sep 27, 2024
…per (elastic#113522)

Adds logic to SyntheticSourceIndexSettingsProvider to check source field mapper to whether synthetic source is enabled.

Before this change the SyntheticSourceIndexSettingsProvider would only check the index.mode setting, which doesn't cover all usages of synthtic source.
elasticsearchmachine pushed a commit that referenced this pull request Sep 27, 2024
…per (#113522) (#113717)

Adds logic to SyntheticSourceIndexSettingsProvider to check source field mapper to whether synthetic source is enabled.

Before this change the SyntheticSourceIndexSettingsProvider would only check the index.mode setting, which doesn't cover all usages of synthtic source.
dnhatn added a commit to dnhatn/elasticsearch that referenced this pull request Sep 29, 2024
@dnhatn dnhatn mentioned this pull request Sep 29, 2024
dnhatn added a commit to dnhatn/elasticsearch that referenced this pull request Sep 29, 2024
@dnhatn dnhatn mentioned this pull request Sep 29, 2024
dnhatn added a commit that referenced this pull request Sep 29, 2024
…ield mapper (#113522) (#113717)" (#113746)

Revert "synthetic source index setting provider should check 
source field mapper (#113522) (#113717)"

This reverts commit c7e2b28.
dnhatn added a commit that referenced this pull request Sep 29, 2024
…ield mapper (#113522)" (#113745)

Revert synthetic source index setting provider should check 
source field mapper introduced in #113522

This reverts commit 0cdcc8c.
martijnvg added a commit to martijnvg/elasticsearch that referenced this pull request Sep 30, 2024
@martijnvg martijnvg added test-full-bwc Trigger full BWC version matrix tests and removed test-full-bwc Trigger full BWC version matrix tests labels Sep 30, 2024
martijnvg added a commit to martijnvg/elasticsearch that referenced this pull request Sep 30, 2024
martijnvg added a commit to martijnvg/elasticsearch that referenced this pull request Sep 30, 2024
martijnvg added a commit that referenced this pull request Oct 1, 2024
…field mapper" (#113759)

Originally added via #113522, but then reverted via #113745, because of mixed cluster test failures (#113730).

This PR is a clean revert of the commit the reverted #113522 and one additional commit that should address the build failures report in #113730 : c7bd242

Basically create index invocation that would fail anyway should be ignored. If mapper service creation now fails, then we just assume that there is no synthetic source usage. This is ok, because the index creation would fail anyway later one.

Closes #113730
martijnvg added a commit to martijnvg/elasticsearch that referenced this pull request Oct 1, 2024
…field mapper" (elastic#113759)

Originally added via elastic#113522, but then reverted via elastic#113745, because of mixed cluster test failures (elastic#113730).

This PR is a clean revert of the commit the reverted elastic#113522 and one additional commit that should address the build failures report in elastic#113730 : c7bd242

Basically create index invocation that would fail anyway should be ignored. If mapper service creation now fails, then we just assume that there is no synthetic source usage. This is ok, because the index creation would fail anyway later one.

Closes elastic#113730
martijnvg added a commit that referenced this pull request Oct 1, 2024
…ource field mapper" (#113759) (#113828)

Backporting #113759 to 8.x branch.

Originally added via #113522, but then reverted via #113745, because of mixed cluster test failures (#113730).

This PR is a clean revert of the commit the reverted #113522 and one additional commit that should address the build failures report in #113730 : c7bd242

Basically create index invocation that would fail anyway should be ignored. If mapper service creation now fails, then we just assume that there is no synthetic source usage. This is ok, because the index creation would fail anyway later one.

Closes #113730
matthewabbott pushed a commit to matthewabbott/elasticsearch that referenced this pull request Oct 4, 2024
…per (elastic#113522)

Adds logic to SyntheticSourceIndexSettingsProvider to check source field mapper to whether synthetic source is enabled.

Before this change the SyntheticSourceIndexSettingsProvider would only check the index.mode setting, which doesn't cover all usages of synthtic source.
matthewabbott pushed a commit to matthewabbott/elasticsearch that referenced this pull request Oct 4, 2024
…ield mapper (elastic#113522)" (elastic#113745)

Revert synthetic source index setting provider should check 
source field mapper introduced in elastic#113522

This reverts commit 0cdcc8c.
matthewabbott pushed a commit to matthewabbott/elasticsearch that referenced this pull request Oct 4, 2024
…field mapper" (elastic#113759)

Originally added via elastic#113522, but then reverted via elastic#113745, because of mixed cluster test failures (elastic#113730).

This PR is a clean revert of the commit the reverted elastic#113522 and one additional commit that should address the build failures report in elastic#113730 : c7bd242

Basically create index invocation that would fail anyway should be ignored. If mapper service creation now fails, then we just assume that there is no synthetic source usage. This is ok, because the index creation would fail anyway later one.

Closes elastic#113730
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants