Skip to content
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

Deprecate _source.mode in mappings (#116689) #117106

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

dnhatn
Copy link
Member

@dnhatn dnhatn commented Nov 20, 2024

This change deprecates _source.mode in mappings, replacing it with the index.mapping.source.mode index setting.

@dnhatn dnhatn added backport auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) test-full-bwc Trigger full BWC version matrix tests v8.17.0 labels Nov 20, 2024
@dnhatn dnhatn force-pushed the 8.17-deprecate-source-mode branch from 80a248b to cd80ee5 Compare November 20, 2024 04:19
@dnhatn dnhatn removed the test-full-bwc Trigger full BWC version matrix tests label Nov 20, 2024
This change deprecates _source.mode in mappings, replacing it with the
index.mapping.source.mode index setting.
@dnhatn dnhatn force-pushed the 8.17-deprecate-source-mode branch from cd80ee5 to f00bb3d Compare November 20, 2024 05:48
@dnhatn dnhatn marked this pull request as ready for review November 20, 2024 05:51
@elasticsearchmachine elasticsearchmachine merged commit e63367e into elastic:8.x Nov 20, 2024
15 checks passed
@dnhatn dnhatn deleted the 8.17-deprecate-source-mode branch November 20, 2024 06:52
martijnvg added a commit to martijnvg/elasticsearch that referenced this pull request Nov 20, 2024
martijnvg added a commit that referenced this pull request Nov 20, 2024
This reverts #117106. Bwc tests fail, because older nodes are killed with the following error:

```
[2024-11-20T10:54:58,600][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [v8.17.0-0] fatal error in thread [elasticsearch[v8.17.0-0
][clusterApplierService#updateTask][T#1]], exiting java.lang.AssertionError: provided source [{"_doc":{"_data_stream_timestamp":{"enabled":true},"_source":{},"properties":{"@timestamp":{"type":"date"},"k8s":{"properties":{"pod":{"properties":{"ip":{"type":"ip"},"name":{"type":"keyword"},"network":{"properties":{"rx":{"type":"long"},"tx":{"type":"long"}}},"uid":{"type":"keyword","time_series_dimension":true}}}}},"metricset":{"type":"keyword","time_series_dimension":true}}}}] differs from mapping [{"_doc":{"_data_stream_timestamp":{"enabled":true},"_source":{"mode":"synthetic"},"properties":{"@timestamp":{"type":"date"},"k8s":{"properties":{"pod":{"properties":{"ip":{"type":"ip"},"name":{"type":"keyword"},"network":{"properties":{"rx":{"type":"long"},"tx":{"type":"long"}}},"uid":{"type":"keyword","time_series_dimension":true}}}}},"metricset":{"type":"keyword","time_series_dimension":true}}}}]
        at [email protected]/org.elasticsearch.index.mapper.DocumentMapper.<init>(DocumentMapper.java:66)
        at [email protected]/org.elasticsearch.index.mapper.MapperService.newDocumentMapper(MapperService.java:588)
        at [email protected]/org.elasticsearch.index.mapper.MapperService.updateMapping(MapperService.java:346)
        at [email protected]/org.elasticsearch.index.IndexService.updateMapping(IndexService.java:840)
        at [email protected]/org.elasticsearch.indices.cluster.IndicesClusterStateService.createIndicesAndUpdateShards(IndicesClusterStateService.java:583)
        at [email protected]/org.elasticsearch.indices.cluster.IndicesClusterStateService.doApplyClusterState(IndicesClusterStateService.java:306)
        at [email protected]/org.elasticsearch.indices.cluster.IndicesClusterStateService.applyClusterState(IndicesClusterStateService.java:260)
        at [email protected]/org.elasticsearch.cluster.service.ClusterApplierService.callClusterStateAppliers(ClusterApplierService.java:544)
        at [email protected]/org.elasticsearch.cluster.service.ClusterApplierService.callClusterStateAppliers(ClusterApplierService.java:530)
        at [email protected]/org.elasticsearch.cluster.service.ClusterApplierService.applyChanges(ClusterApplierService.java:503)
        at [email protected]/org.elasticsearch.cluster.service.ClusterApplierService.runTask(ClusterApplierService.java:432)
        at [email protected]/org.elasticsearch.cluster.service.ClusterApplierService$UpdateTask.run(ClusterApplierService.java:157)
        at [email protected]/org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:956)
        at [email protected]/org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:218)
        at [email protected]/org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:184)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at java.base/java.lang.Thread.run(Thread.java:1575)
```

The `mode` parameter no longer gets serialized for new indices. However on the older nodes still serialize the `mode` parameter, which caused the menioned assertion to fail. Reverting for now and see how best to address this bwc serialization issue.

We can only stop serializing mode, when all nodes are on the same version.  Unfortunately we can't invoke `c.clusterTransportVersion().get()` from parser or builder, because that calling thread isn't allowed to call `clusterService.state()`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport v8.17.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants