-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Turn _source meta fieldmapper's mode attribute into a no-op. #119072
base: main
Are you sure you want to change the base?
Conversation
@@ -160,13 +164,21 @@ public static class Builder extends MetadataFieldMapper.Builder { | |||
private boolean serializeMode; | |||
|
|||
private final boolean supportsNonDefaultParameterValues; | |||
|
|||
public Builder(IndexMode indexMode, final Settings settings, boolean supportsCheckForNonDefaultParams, boolean serializeMode) { | |||
private final boolean sourceModeIsNoop; |
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.
Another boolean field... but we need to a way to allow indices created before 9.0.0 to support the _source.mode attribute and only from 9.0.0 it will truly be a no-op.
@@ -1860,10 +1859,7 @@ public static CreateIndexResponse createIndex(RestClient client, String name, Se | |||
|
|||
if (settings != null && settings.getAsBoolean(IndexSettings.INDEX_SOFT_DELETES_SETTING.getKey(), true) == false) { | |||
expectSoftDeletesWarning(request, name); | |||
} else if (isSyntheticSourceConfiguredInMapping(mapping) |
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.
Remove logic that allows deprecation warning because of _source.mode mapping attribute usage.
Instead no tests should emit this warning, except tests that specifically test the _source.mode deprecation warning.
@@ -485,8 +484,6 @@ public void checkWarningHeaders(final List<String> warningHeaders, String testPa | |||
} | |||
} | |||
|
|||
unexpected.removeIf(s -> s.endsWith(SourceFieldMapper.DEPRECATION_WARNING + "\"")); | |||
|
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.
Remove logic that allows deprecation warning because of _source.mode mapping attribute usage.
- match: { test_stored_override.mappings._source.mode: synthetic } | ||
|
||
--- | ||
override stored to disabled source mode: |
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.
Tests that both that test overwrite behaviour when source mode index setting and _source.mode mapping attribute are specified are no longer relevant with this change.
modify source mapping from stored to synthetic after index creation: | ||
- do: | ||
warnings: | ||
- "Configuring source mode in mappings is deprecated and will be removed in future versions. Use [index.mapping.source.mode] index setting instead." |
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 diff is messy, but just tests that _source.mode mapping attribute is allowed to be used but is snoop and emits deprecation warning.
Note to reviewer:
|
Hi @martijnvg, I've created a changelog YAML for you. Note that since this PR is labelled |
Pinging @elastic/es-storage-engine (Team:StorageEngine) |
Closes #118596