-
Notifications
You must be signed in to change notification settings - Fork 25.2k
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
synthetic source index setting provider should check source field mapper #113522
Conversation
…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.
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( |
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.
this is the core of the change: instead of checking the index.mode setting, this now uses SourceFieldMapper#isSynthetic()
to determine synthetic source usage..
} | ||
|
||
tmpIndexMetadata.settings(finalResolvedSettings); | ||
// Create MapperService just to extract keyword dimension fields: |
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.
I don't understand this comment...I don't see we are extracting dimensions...
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.
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); |
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.
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
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.
👍 makes sense
…ngsProvider_check_mapping
💚 Backport successful
|
…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.
…ield mapper (elastic#113522)" This reverts commit 0cdcc8c.
…ield mapper (elastic#113522) (elastic#113717)" This reverts commit c7e2b28.
…field mapper (elastic#113522)" (elastic#113745) This reverts commit e0a2d61.
…field mapper (elastic#113522)" (elastic#113745) This reverts commit e0a2d61.
…field mapper (elastic#113522)" (elastic#113745) This reverts commit e0a2d61.
…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
…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
…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
…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.
…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.
…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
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.