Skip to content

Commit bc1f50c

Browse files
authored
Permit wait_for_active_shards warnings in master (#67498)
Part of the fixes for #66419, this commit permits nodes to emit the deprecation warning regarding not specifying `?wait_for_active_shards` when closing an index in 7.x versions for x ≥ 12. This change is required on `master` too since the BWC tests encounter these warnings. Relates #67246, which is the 7.x part of this change.
1 parent eed5494 commit bc1f50c

File tree

34 files changed

+179
-4
lines changed

34 files changed

+179
-4
lines changed

plugins/repository-hdfs/src/test/resources/rest-api-spec/test/hdfs_repository/40_restore.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#
55
---
66
"Create a snapshot and then restore it":
7+
- skip:
8+
features: ["allowed_warnings"]
79

810
# Create repository
911
- do:
@@ -47,6 +49,8 @@
4749
- do:
4850
indices.close:
4951
index : test_index
52+
allowed_warnings:
53+
- "the default value for the ?wait_for_active_shards parameter will change from '0' to 'index-setting' in version 8; specify '?wait_for_active_shards=index-setting' to adopt the future default behaviour, or '?wait_for_active_shards=0' to preserve today's behaviour"
5054

5155
# Restore index
5256
- do:

plugins/repository-hdfs/src/test/resources/rest-api-spec/test/secure_hdfs_repository/40_restore.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#
55
---
66
"Create a snapshot and then restore it":
7+
- skip:
8+
features: ["allowed_warnings"]
79

810
# Create repository
911
- do:
@@ -49,6 +51,8 @@
4951
- do:
5052
indices.close:
5153
index : test_index
54+
allowed_warnings:
55+
- "the default value for the ?wait_for_active_shards parameter will change from '0' to 'index-setting' in version 8; specify '?wait_for_active_shards=index-setting' to adopt the future default behaviour, or '?wait_for_active_shards=0' to preserve today's behaviour"
5256

5357
# Restore index
5458
- do:

rest-api-spec/src/main/resources/rest-api-spec/test/cat.aliases/10_basic.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@
388388
- skip:
389389
version: " - 7.3.99"
390390
reason: "is_write_index is shown in cat.aliases starting version 7.4.0"
391+
features: ["allowed_warnings"]
391392

392393
- do:
393394
indices.create:
@@ -399,6 +400,8 @@
399400
- do:
400401
indices.close:
401402
index: test_index
403+
allowed_warnings:
404+
- "the default value for the ?wait_for_active_shards parameter will change from '0' to 'index-setting' in version 8; specify '?wait_for_active_shards=index-setting' to adopt the future default behaviour, or '?wait_for_active_shards=0' to preserve today's behaviour"
402405

403406
- do:
404407
cat.aliases:
@@ -419,7 +422,7 @@
419422
"Alias against closed index (pre 7.4.0)":
420423
- skip:
421424
version: "7.4.0 - "
422-
features: node_selector
425+
features: ["node_selector", "allowed_warnings"]
423426
reason: "is_write_index is shown in cat.aliases starting version 7.4.0"
424427

425428
- do:
@@ -432,6 +435,8 @@
432435
- do:
433436
indices.close:
434437
index: test_index
438+
allowed_warnings:
439+
- "the default value for the ?wait_for_active_shards parameter will change from '0' to 'index-setting' in version 8; specify '?wait_for_active_shards=index-setting' to adopt the future default behaviour, or '?wait_for_active_shards=0' to preserve today's behaviour"
435440

436441
- do:
437442
node_selector:

rest-api-spec/src/main/resources/rest-api-spec/test/cat.indices/10_basic.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
- skip:
5555
version: "7.2.0 - "
5656
reason: "closed indices are replicated starting version 7.2.0"
57+
features: ["allowed_warnings"]
5758

5859
- do:
5960
indices.create:
@@ -66,6 +67,8 @@
6667
- do:
6768
indices.close:
6869
index: index-2
70+
allowed_warnings:
71+
- "the default value for the ?wait_for_active_shards parameter will change from '0' to 'index-setting' in version 8; specify '?wait_for_active_shards=index-setting' to adopt the future default behaviour, or '?wait_for_active_shards=0' to preserve today's behaviour"
6972
- is_true: acknowledged
7073

7174
- do:
@@ -95,6 +98,7 @@
9598
- skip:
9699
version: " - 7.1.99"
97100
reason: "closed indices are replicated starting version 7.2.0"
101+
features: ["allowed_warnings"]
98102

99103
- do:
100104
indices.create:
@@ -107,6 +111,8 @@
107111
- do:
108112
indices.close:
109113
index: index-2
114+
allowed_warnings:
115+
- "the default value for the ?wait_for_active_shards parameter will change from '0' to 'index-setting' in version 8; specify '?wait_for_active_shards=index-setting' to adopt the future default behaviour, or '?wait_for_active_shards=0' to preserve today's behaviour"
110116
- is_true: acknowledged
111117

112118
- do:
@@ -221,6 +227,8 @@
221227
222228
---
223229
"Test cat indices sort":
230+
- skip:
231+
features: ["allowed_warnings"]
224232

225233
- do:
226234
indices.create:
@@ -249,6 +257,8 @@
249257
- do:
250258
indices.close:
251259
index: bar
260+
allowed_warnings:
261+
- "the default value for the ?wait_for_active_shards parameter will change from '0' to 'index-setting' in version 8; specify '?wait_for_active_shards=index-setting' to adopt the future default behaviour, or '?wait_for_active_shards=0' to preserve today's behaviour"
252262

253263
- do:
254264
cat.indices:

rest-api-spec/src/main/resources/rest-api-spec/test/cat.recovery/10_basic.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
- skip:
8585
version: " - 7.99.99"
8686
reason: format of bytes output changed in 8.0.0
87+
features: ["allowed_warnings"]
8788

8889
- do:
8990
indices.create:
@@ -96,6 +97,8 @@
9697
- do:
9798
indices.close:
9899
index: index2
100+
allowed_warnings:
101+
- "the default value for the ?wait_for_active_shards parameter will change from '0' to 'index-setting' in version 8; specify '?wait_for_active_shards=index-setting' to adopt the future default behaviour, or '?wait_for_active_shards=0' to preserve today's behaviour"
99102
- is_true: acknowledged
100103

101104
- do:

rest-api-spec/src/main/resources/rest-api-spec/test/cat.segments/10_basic.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@
8383
8484
---
8585
"Test cat segments on closed index behaviour":
86+
- skip:
87+
features: ["allowed_warnings"]
8688

8789
- do:
8890
indices.create:
@@ -95,6 +97,8 @@
9597
- do:
9698
indices.close:
9799
index: index1
100+
allowed_warnings:
101+
- "the default value for the ?wait_for_active_shards parameter will change from '0' to 'index-setting' in version 8; specify '?wait_for_active_shards=index-setting' to adopt the future default behaviour, or '?wait_for_active_shards=0' to preserve today's behaviour"
98102

99103
- do:
100104
catch: bad_request

rest-api-spec/src/main/resources/rest-api-spec/test/cluster.allocation_explain/10_basic.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
- skip:
5353
version: " - 7.1.99"
5454
reason: closed indices are replicated starting version 7.2.0
55+
features: ["allowed_warnings"]
5556

5657
- do:
5758
indices.create:
@@ -68,6 +69,8 @@
6869
- do:
6970
indices.close:
7071
index: test_closed
72+
allowed_warnings:
73+
- "the default value for the ?wait_for_active_shards parameter will change from '0' to 'index-setting' in version 8; specify '?wait_for_active_shards=index-setting' to adopt the future default behaviour, or '?wait_for_active_shards=0' to preserve today's behaviour"
7174

7275
- match: { acknowledged: true }
7376

rest-api-spec/src/main/resources/rest-api-spec/test/cluster.health/10_basic.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@
134134
- skip:
135135
version: "7.2.0 - "
136136
reason: "closed indices are replicated starting version 7.2.0"
137+
features: ["allowed_warnings"]
137138

138139
- do:
139140
indices.create:
@@ -180,6 +181,8 @@
180181
- do:
181182
indices.close:
182183
index: index-2
184+
allowed_warnings:
185+
- "the default value for the ?wait_for_active_shards parameter will change from '0' to 'index-setting' in version 8; specify '?wait_for_active_shards=index-setting' to adopt the future default behaviour, or '?wait_for_active_shards=0' to preserve today's behaviour"
183186
- is_true: acknowledged
184187

185188
# closing the index-2 turns the cluster health back to green
@@ -208,6 +211,7 @@
208211
- skip:
209212
version: " - 7.1.99"
210213
reason: "closed indices are replicated starting version 7.2.0"
214+
features: ["allowed_warnings"]
211215

212216
- do:
213217
indices.create:
@@ -255,6 +259,8 @@
255259
- do:
256260
indices.close:
257261
index: index-2
262+
allowed_warnings:
263+
- "the default value for the ?wait_for_active_shards parameter will change from '0' to 'index-setting' in version 8; specify '?wait_for_active_shards=index-setting' to adopt the future default behaviour, or '?wait_for_active_shards=0' to preserve today's behaviour"
258264
- is_true: acknowledged
259265

260266
- do:

rest-api-spec/src/main/resources/rest-api-spec/test/cluster.health/30_indices_options.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
setup:
2+
- skip:
3+
features: ["allowed_warnings"]
24

35
- do:
46
indices.create:
@@ -23,6 +25,8 @@ setup:
2325
- do:
2426
indices.close:
2527
index: index-2
28+
allowed_warnings:
29+
- "the default value for the ?wait_for_active_shards parameter will change from '0' to 'index-setting' in version 8; specify '?wait_for_active_shards=index-setting' to adopt the future default behaviour, or '?wait_for_active_shards=0' to preserve today's behaviour"
2630

2731
- do:
2832
cluster.health:

rest-api-spec/src/main/resources/rest-api-spec/test/cluster.state/30_expand_wildcards.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
setup:
2+
- skip:
3+
features: ["allowed_warnings"]
24

35
- do:
46
indices.create:
@@ -25,6 +27,8 @@ setup:
2527
- do:
2628
indices.close:
2729
index: test_close_index
30+
allowed_warnings:
31+
- "the default value for the ?wait_for_active_shards parameter will change from '0' to 'index-setting' in version 8; specify '?wait_for_active_shards=index-setting' to adopt the future default behaviour, or '?wait_for_active_shards=0' to preserve today's behaviour"
2832

2933
---
3034
"Test expand_wildcards parameter on closed, open indices and both":

rest-api-spec/src/main/resources/rest-api-spec/test/indices.get/10_basic.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
---
22
setup:
3+
- skip:
4+
features: ["allowed_warnings"]
35

46
- do:
57
indices.create:
@@ -38,6 +40,8 @@ setup:
3840
- do:
3941
indices.close:
4042
index: test_index_3
43+
allowed_warnings:
44+
- "the default value for the ?wait_for_active_shards parameter will change from '0' to 'index-setting' in version 8; specify '?wait_for_active_shards=index-setting' to adopt the future default behaviour, or '?wait_for_active_shards=0' to preserve today's behaviour"
4145

4246
- do:
4347
cluster.health:

rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_alias/10_basic.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
setup:
3-
43
- do:
54
indices.create:
65
index: test_index
@@ -303,10 +302,14 @@ setup:
303302

304303
---
305304
"Get alias against closed indices":
305+
- skip:
306+
features: ["allowed_warnings"]
306307

307308
- do:
308309
indices.close:
309310
index: test_index_2
311+
allowed_warnings:
312+
- "the default value for the ?wait_for_active_shards parameter will change from '0' to 'index-setting' in version 8; specify '?wait_for_active_shards=index-setting' to adopt the future default behaviour, or '?wait_for_active_shards=0' to preserve today's behaviour"
310313

311314
- do:
312315
indices.get_alias:

rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_mapping/50_wildcard_expansion.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
---
22
setup:
3+
- skip:
4+
features: ["allowed_warnings"]
5+
36
- do:
47
indices.create:
58
index: test-xxx
@@ -52,6 +55,8 @@ setup:
5255
- do:
5356
indices.close:
5457
index: test-xyy
58+
allowed_warnings:
59+
- "the default value for the ?wait_for_active_shards parameter will change from '0' to 'index-setting' in version 8; specify '?wait_for_active_shards=index-setting' to adopt the future default behaviour, or '?wait_for_active_shards=0' to preserve today's behaviour"
5560

5661
- do:
5762
cluster.health:

rest-api-spec/src/main/resources/rest-api-spec/test/indices.open/10_basic.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
---
22
"Basic test for index open/close":
3+
- skip:
4+
features: ["allowed_warnings"]
5+
36
- do:
47
indices.create:
58
index: test_index
@@ -14,6 +17,8 @@
1417
- do:
1518
indices.close:
1619
index: test_index
20+
allowed_warnings:
21+
- "the default value for the ?wait_for_active_shards parameter will change from '0' to 'index-setting' in version 8; specify '?wait_for_active_shards=index-setting' to adopt the future default behaviour, or '?wait_for_active_shards=0' to preserve today's behaviour"
1722
- is_true: acknowledged
1823

1924
- do:
@@ -38,6 +43,8 @@
3843

3944
---
4045
"Open index with wait_for_active_shards set to all":
46+
- skip:
47+
features: ["allowed_warnings"]
4148

4249
- do:
4350
indices.create:
@@ -49,6 +56,8 @@
4956
- do:
5057
indices.close:
5158
index: test_index
59+
allowed_warnings:
60+
- "the default value for the ?wait_for_active_shards parameter will change from '0' to 'index-setting' in version 8; specify '?wait_for_active_shards=index-setting' to adopt the future default behaviour, or '?wait_for_active_shards=0' to preserve today's behaviour"
5261
- is_true: acknowledged
5362

5463
- do:
@@ -81,6 +90,9 @@
8190
- match: { shards_acknowledged: true }
8291
---
8392
"Close index response with result per index":
93+
- skip:
94+
features: ["allowed_warnings"]
95+
8496
- do:
8597
indices.create:
8698
index: index_1
@@ -105,6 +117,8 @@
105117
- do:
106118
indices.close:
107119
index: "index_*"
120+
allowed_warnings:
121+
- "the default value for the ?wait_for_active_shards parameter will change from '0' to 'index-setting' in version 8; specify '?wait_for_active_shards=index-setting' to adopt the future default behaviour, or '?wait_for_active_shards=0' to preserve today's behaviour"
108122

109123
- match: { acknowledged: true }
110124
- match: { shards_acknowledged: true }

rest-api-spec/src/main/resources/rest-api-spec/test/indices.open/20_multiple_indices.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,14 @@ setup:
2323

2424
---
2525
"All indices":
26+
- skip:
27+
features: ["allowed_warnings"]
28+
2629
- do:
2730
indices.close:
2831
index: _all
32+
allowed_warnings:
33+
- "the default value for the ?wait_for_active_shards parameter will change from '0' to 'index-setting' in version 8; specify '?wait_for_active_shards=index-setting' to adopt the future default behaviour, or '?wait_for_active_shards=0' to preserve today's behaviour"
2934
- is_true: acknowledged
3035

3136
- do:
@@ -50,9 +55,14 @@ setup:
5055

5156
---
5257
"Trailing wildcard":
58+
- skip:
59+
features: ["allowed_warnings"]
60+
5361
- do:
5462
indices.close:
5563
index: test_*
64+
allowed_warnings:
65+
- "the default value for the ?wait_for_active_shards parameter will change from '0' to 'index-setting' in version 8; specify '?wait_for_active_shards=index-setting' to adopt the future default behaviour, or '?wait_for_active_shards=0' to preserve today's behaviour"
5666
- is_true: acknowledged
5767

5868
- do:
@@ -77,9 +87,14 @@ setup:
7787

7888
---
7989
"Only wildcard":
90+
- skip:
91+
features: ["allowed_warnings"]
92+
8093
- do:
8194
indices.close:
8295
index: '*'
96+
allowed_warnings:
97+
- "the default value for the ?wait_for_active_shards parameter will change from '0' to 'index-setting' in version 8; specify '?wait_for_active_shards=index-setting' to adopt the future default behaviour, or '?wait_for_active_shards=0' to preserve today's behaviour"
8398
- is_true: acknowledged
8499

85100
- do:

0 commit comments

Comments
 (0)