Commit b636be3
authored
Enable synthetic_id by default under feature flag (#144026)
* Enable synthetic_id by default if settings are valid
Newly created time_series indices use synthetic id by default.
The new IndexVersion, TIME_SERIES_USE_SYNTHETIC_ID_DEFAULT, prevent old indices
(with older index version) from changing default behavior.
`index.mapping.synthetic_id` defaults to true if
- Feature flag TSDB_SYNTHETIC_ID_FEATURE_FLAG is enabled
- index mode is time_series
- index version is TIME_SERIES_USE_SYNTHETIC_ID_DEFAULT or later
- codec is default or unset
and setting is still allowed to be explicitly set if index version
is TIME_SERIES_USE_SYNTHETIC_ID_94 or later. Only the default behavior
is controlled by TIME_SERIES_USE_SYNTHETIC_ID_DEFAULT.
This default logic is duplicated by IndexMetadata to make sure metadata always
agree with Settings.
MODE setting moved above SYNTHETIC_ID to allow access.
* NodeFeature index.time_series_synthetic_id_default
Making sure to add this node feature in the same PR as adding the new
index version, `TIME_SERIES_USE_SYNTHETIC_ID_DEFAULT` to make sure the
node feature can be used as a shortcut / replacement for checking
version in tests.
* Skip tsdb/25_id... and delete/70_tsdb in yamlRestCompatTest
The compat tests run with a copy of the yaml file from the BWC branch,
which doesn't contain the skip for index.time_series_synthetic_id.
This means the hardcoded ids in the test doesn't match with actual
default behavior anymore, so we skip those tests in the compatibility
run.
This is safe because the behavior is not changed for existing indices
that don't use synthetic id. Only new indices will have the changed
behavior, so there is no compatibility issue.
To make this work we nedd to make it possible to skip compatibility
tests with overloaded names.
If the name of the test is also a name of an operation such as `get` or
`delete` in below examples, then the build would fail with
```
Execution failed for task ':rest-api-spec:yamlRestCompatTestTransform'.
> class com.fasterxml.jackson.databind.node.ObjectNode cannot be cast to
class com.fasterxml.jackson.databind.node.ArrayNode
```
Instead of throwing an (assert) exception if the node to transform
(skip) is of the wrong type, we now just ignore it instead.
Example of test that could not be skipped before, but that can be
skipped now:
```
get:
- do:
get:
index: id_generation_test
id: cZZNs7B9sSWsyrL5AAABeRnSA5M
```
---
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> and Cursor1 parent 256a390 commit b636be3
File tree
8 files changed
+179
-39
lines changed- build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/transform/skip
- modules/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams
- rest-api-spec
- server/src
- main/java/org/elasticsearch
- cluster/metadata
- index
- test/java/org/elasticsearch/index
8 files changed
+179
-39
lines changedLines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
91 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
92 | 98 | | |
93 | 99 | | |
94 | 100 | | |
| |||
Lines changed: 65 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
1297 | 1298 | | |
1298 | 1299 | | |
1299 | 1300 | | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
1300 | 1365 | | |
1301 | 1366 | | |
1302 | 1367 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
161 | 173 | | |
Lines changed: 15 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
| |||
2574 | 2576 | | |
2575 | 2577 | | |
2576 | 2578 | | |
2577 | | - | |
2578 | | - | |
2579 | | - | |
2580 | | - | |
2581 | | - | |
2582 | | - | |
2583 | | - | |
2584 | | - | |
2585 | | - | |
| 2579 | + | |
2586 | 2580 | | |
2587 | 2581 | | |
2588 | 2582 | | |
| |||
2642 | 2636 | | |
2643 | 2637 | | |
2644 | 2638 | | |
| 2639 | + | |
| 2640 | + | |
| 2641 | + | |
| 2642 | + | |
| 2643 | + | |
| 2644 | + | |
| 2645 | + | |
| 2646 | + | |
| 2647 | + | |
| 2648 | + | |
| 2649 | + | |
| 2650 | + | |
2645 | 2651 | | |
2646 | 2652 | | |
2647 | 2653 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| 55 | + | |
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
| |||
Lines changed: 37 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
681 | 681 | | |
682 | 682 | | |
683 | 683 | | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
684 | 710 | | |
685 | | - | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
686 | 721 | | |
687 | 722 | | |
688 | 723 | | |
| |||
717 | 752 | | |
718 | 753 | | |
719 | 754 | | |
720 | | - | |
| 755 | + | |
721 | 756 | | |
722 | 757 | | |
723 | 758 | | |
| |||
757 | 792 | | |
758 | 793 | | |
759 | 794 | | |
760 | | - | |
761 | | - | |
762 | | - | |
763 | | - | |
764 | | - | |
765 | | - | |
766 | | - | |
767 | | - | |
768 | | - | |
769 | | - | |
770 | | - | |
771 | | - | |
772 | | - | |
773 | | - | |
774 | | - | |
775 | | - | |
776 | | - | |
777 | | - | |
778 | | - | |
779 | | - | |
780 | | - | |
781 | | - | |
782 | | - | |
783 | | - | |
784 | | - | |
785 | | - | |
786 | 795 | | |
787 | 796 | | |
788 | 797 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
| 240 | + | |
240 | 241 | | |
241 | 242 | | |
242 | 243 | | |
| |||
Lines changed: 39 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
978 | 978 | | |
979 | 979 | | |
980 | 980 | | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
981 | 1020 | | |
982 | 1021 | | |
983 | 1022 | | |
| |||
0 commit comments