Synthetic id field for time_series indices (remove feature flag)#144184
Conversation
This commit removes the feature flag for synthetic id and thereby makes it officially available in production. The setting is controlled by `index.mapping.synthetic_id` which default to `true` for new time_series indices, as long as they use the default codec. Indices with synthetic _id fields doesn't store the id physically on disk. Instead, the id is materialized synthetically from other document fields. This reduces the footprint on disk for time_series indices.
2642cff to
d0d08f6
Compare
|
Pinging @elastic/es-storage-engine (Team:StorageEngine) |
|
Hi @burqen, I've created a changelog YAML for you. |
|
Test failures:
Triggering another run |
Add logging for index settings and node versions after index creation in ClientYamlTestClient
…etic-id-default-and-remove-feature-flag
Analysis of id mismatch failure in MixedClusterClientYamlTestSuiteITSummary: Both old node dies because of known issue, #143980. With only new nodes left, time_series index use synthetic id by default which is counter to the test expectation. I don't see a way to protect against this and i think it's reasonable to assume that the test cluster stays intact. If it falls apart, it's because of another bug somewhere. Full analysis Relevant test failure This is a mixed cluster test that has two 9.3.3-SNAPSHOT nodes, and two 9.4.0-SNAPSHOT nodes. For some reason the index uses synthetic id by default (it is not set in My current theory is that the two older nodes have died and the cluster is operating on only the two newer nodes. They would then give 4bc666f add temporary logging to try and catch index version and the state of cluster nodes when creating the index used by EDIT: The test uses synthetic id because both old nodes disconnect from the cluster (leaving only new nodes left which will default to synthetic id for time_series indices) Cluster Timeline —
|
| Time | Event |
|---|---|
| 15:52:04 | Cluster forms. v9.3.3-1 elected master. All 4 nodes at 9.3.3 |
| 15:52:06 | v9.3.3-0 disconnects (upgrading) |
| 15:52:33 | v9.3.3-0 rejoins at 9.4.0, wins new election (term 3), becomes master |
| 15:52:34 | v9.3.3-1 disconnects (upgrading) |
| 15:53:01 | v9.3.3-1 rejoins at 9.4.0 |
Index creation cluster membership
| # | Time | Nodes in cluster | Notes |
|---|---|---|---|
| 1 | 15:53:18 | v9.3.3-0 (9.4.0, master), v9.3.3-1 (9.4.0), v9.3.3-2 (9.3.3), v9.3.3-3 (9.3.3) | Full 4-node mixed cluster |
| — | 15:54:16 | v9.3.3-2 disconnects (reason: disconnected) | |
| 2–6 | 15:54:48–15:59:01 | v9.3.3-0 (9.4.0, master), v9.3.3-1 (9.4.0), v9.3.3-3 (9.3.3) | 3-node mixed cluster |
| — | 16:01:24 | v9.3.3-3 disconnects (reason: disconnected) | |
| 7–15 | 16:16:09–16:21:41 | v9.3.3-0 (9.4.0, master), v9.3.3-1 (9.4.0) | 2-node fully-upgraded cluster |
Key observations
- Master is always v9.3.3-0 at 9.4.0 — it wins the election after restart and holds it throughout.
- Creation # 1 happens in the fully mixed state (2 old + 2 new nodes). This is the most interesting from an ID generation perspective — both upgraded and non-upgraded nodes are data nodes.
- Creations # 2–6 happen in a partially mixed state (1 old node v9.3.3-3 still in cluster).
- Creations # 7–15 happen after all old nodes have left — pure 9.4.0 cluster. These are the "fully upgraded" test runs.
EDIT 2: Node v9.3.3-2 and v9.3.3-3 die because of changes in serialization of confidence_interval mapping. It's a known issue:
- Tracking issue: [CI] MixedClusterClientYamlTestSuiteIT class failing #143980 —
[CI] MixedClusterClientYamlTestSuiteIT class failing (open, assigned to tteofili, labelled priority:high)
• Fix PR: Make int4 confidence_interval BWC for mixed cluster scenarios #144597 — Make int4 confidence_interval BWC for mixed cluster scenarios (open, references [CI] MixedClusterClientYamlTestSuiteIT class failing #143980 as the issue it fixes)
Full stacktrace:
[2026-03-19T15:54:15,799][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [v9.3.3-2] fatal error in thread [elasticsearch[v9.3.3-2][clusterApplierService#updateTask][T#1]], exiting
java.lang.AssertionError: provided source [{"_doc":{"properties":{"another_vector":{"type":"dense_vector","dims":4,"index":true,"similarity":"l2_norm","index_options":{"type":"int4_hnsw","m":16,"ef_construction":100}},"name":{"type":"keyword"},"vector":{"type":"dense_vector","dims":4,"index":true,"similarity":"l2_norm","index_options":{"type":"int4_hnsw","m":16,"ef_construction":100}}}}}] differs from mapping [{"_doc":{"properties":{"another_vector":{"type":"dense_vector","dims":4,"index":true,"similarity":"l2_norm","index_options":{"type":"int4_hnsw","m":16,"ef_construction":100,"confidence_interval":0.0}},"name":{"type":"keyword"},"vector":{"type":"dense_vector","dims":4,"index":true,"similarity":"l2_norm","index_options":{"type":"int4_hnsw","m":16,"ef_construction":100,"confidence_interval":0.0}}}}}]
at org.elasticsearch.index.mapper.DocumentMapper.<init>(DocumentMapper.java:74) ~[elasticsearch-9.3.3-SNAPSHOT.jar:?]
at org.elasticsearch.index.mapper.MapperService.newDocumentMapper(MapperService.java:644) ~[elasticsearch-9.3.3-SNAPSHOT.jar:?]
at org.elasticsearch.index.mapper.MapperService.updateMapping(MapperService.java:396) ~[elasticsearch-9.3.3-SNAPSHOT.jar:?]
at org.elasticsearch.index.IndexService.updateMapping(IndexService.java:886) ~[elasticsearch-9.3.3-SNAPSHOT.jar:?]
at org.elasticsearch.indices.cluster.IndicesClusterStateService.createIndicesAndUpdateShards(IndicesClusterStateService.java:644) ~[elasticsearch-9.3.3-SNAPSHOT.jar:?]
at org.elasticsearch.indices.cluster.IndicesClusterStateService.doApplyClusterState(IndicesClusterStateService.java:359) ~[elasticsearch-9.3.3-SNAPSHOT.jar:?]
at org.elasticsearch.indices.cluster.IndicesClusterStateService.applyClusterState(IndicesClusterStateService.java:304) ~[elasticsearch-9.3.3-SNAPSHOT.jar:?]
at org.elasticsearch.cluster.service.ClusterApplierService.callClusterStateAppliers(ClusterApplierService.java:605) ~[elasticsearch-9.3.3-SNAPSHOT.jar:?]
at org.elasticsearch.cluster.service.ClusterApplierService.callClusterStateAppliers(ClusterApplierService.java:591) ~[elasticsearch-9.3.3-SNAPSHOT.jar:?]
at org.elasticsearch.cluster.service.ClusterApplierService.applyChanges(ClusterApplierService.java:564) ~[elasticsearch-9.3.3-SNAPSHOT.jar:?]
at org.elasticsearch.cluster.service.ClusterApplierService.runTask(ClusterApplierService.java:493) ~[elasticsearch-9.3.3-SNAPSHOT.jar:?]
at org.elasticsearch.cluster.service.ClusterApplierService$UpdateTask.run(ClusterApplierService.java:183) ~[elasticsearch-9.3.3-SNAPSHOT.jar:?]
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:1046) ~[elasticsearch-9.3.3-SNAPSHOT.jar:?]
at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:218) ~[elasticsearch-9.3.3-SNAPSHOT.jar:?]
at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:184) ~[elasticsearch-9.3.3-SNAPSHOT.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1090) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614) ~[?:?]
at java.lang.Thread.run(Thread.java:1474) ~[?:?]
…etic-id-default-and-remove-feature-flag
This reverts commit 4bc666f.
…ic-id-default-and-remove-feature-flag
…ic-id-default-and-remove-feature-flag
…ic-id-default-and-remove-feature-flag
…ic-id-default-and-remove-feature-flag
…ic-id-default-and-remove-feature-flag
|
Let's also add a release highlight note for this. |
…etic-id-default-and-remove-feature-flag
|
This is getting close to ready. The only thing missing now is a green build and a 👍 from you fine Storage engine folk. I'm pinging you @kkrik-es, since you've been involved here lately, but please feel free to forward the review request if you think that is a better fit. |
…stic#144184) * Synthetic id field for time_series indices This commit removes the feature flag for synthetic id and thereby makes it officially available in production. The setting is controlled by `index.mapping.synthetic_id` which default to `true` for new time_series indices, as long as they use the default codec. Indices with synthetic _id fields doesn't store the id physically on disk. Instead, the id is materialized synthetically from other document fields. This reduces the footprint on disk for time_series indices. * Update docs/changelog/144184.yaml * Temporary logging for tsdb/25_id Add logging for index settings and node versions after index creation in ClientYamlTestClient * Bump IndexVersion for synthetic id On by default Bump the IndexVersion that protect default behavior so that existing time_series indices keep their current behavior and only new indices, created with the new index version use synthetic id by default. * Remove feature flag added in merge * Avoid use of setting when feature flag disabled Only set DISABLE_SEQUENCE_NUMBERS explicitly if the feature flag is enabled in TSDBSyntheticIdsIT. * Disable synthetic id in faulty version range --------- Co-authored-by: Francisco Fernández Castaño <francisco.fernandez.castano@gmail.com> Co-authored-by: Tanguy Leroux <tlrx.dev@gmail.com>
This commit removes the feature flag for synthetic id and thereby makes
it officially available in production. The setting is controlled by
index.mapping.synthetic_idwhich default totruefor new time_seriesindices, as long as they use the default codec.
Indices with synthetic _id fields doesn't store the id physically on
disk. Instead, the id is materialized synthetically from other document
fields. This reduces the footprint on disk for time_series indices.
NOTE! The changes themselves are not super interesting, but this will enable synthetic id everywhere, turned ON by default, and as such might need some extra care.
The slightly more interesting changes are in:
server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadata.javaserver/src/main/java/org/elasticsearch/common/settings/IndexScopedSettings.javaserver/src/main/java/org/elasticsearch/index/IndexSettings.java