Skip to content

Commit

Permalink
[9.0] Remove unsupported value for the query param `wait_for_active_s…
Browse files Browse the repository at this point in the history
…hards` in close API. (#118555)

Since 8.0, the default behavior for closing indices has been to wait for the active shards based on the index setting. The special value index-setting allows users to use this in 7.x as well. We'd like to make true our promise in the deprecation warning that this parameter should no longer be used, since it will become unsupported in 9.0.0.
  • Loading branch information
gmarouli authored Dec 19, 2024
1 parent 6ec8f95 commit b6345a3
Show file tree
Hide file tree
Showing 35 changed files with 46 additions and 110 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@
- do:
indices.close:
index: logs-*
allowed_warnings:
- "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"
- is_true: acknowledged
- length: { indices: 0 }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,6 @@ teardown:
- do:
indices.close:
index: ".ds-simple-data-stream1-*000001,.ds-simple-data-stream1-*000002"
allowed_warnings:
- "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"
- is_true: acknowledged

- do:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ setup:
- do:
indices.close:
index: test_index2
allowed_warnings:
- "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"

- do:
indices.create:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@
- do:
indices.close:
index : test_index
allowed_warnings:
- "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"

# Restore index
- do:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@
- do:
indices.close:
index : test_index
allowed_warnings:
- "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"

# Restore index
- do:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,6 @@
- do:
indices.close:
index: test_index
allowed_warnings:
- "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"

- do:
cat.aliases:
Expand Down Expand Up @@ -425,8 +423,6 @@
- do:
indices.close:
index: test_index
allowed_warnings:
- "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"

- do:
cat.aliases: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@
- do:
indices.close:
index: index-2
allowed_warnings:
- "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"
- is_true: acknowledged

- do:
Expand Down Expand Up @@ -132,8 +130,6 @@
- do:
indices.close:
index: index-2
allowed_warnings:
- "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"
- is_true: acknowledged

- do:
Expand Down Expand Up @@ -278,8 +274,6 @@
- do:
indices.close:
index: bar
allowed_warnings:
- "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"

- do:
cat.indices:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@
- do:
indices.close:
index: index2
allowed_warnings:
- "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"
- is_true: acknowledged

- do:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@
- do:
indices.close:
index: index1
allowed_warnings:
- "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"

- do:
catch: bad_request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@
- do:
indices.close:
index: test_closed
allowed_warnings:
- "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"

- match: { acknowledged: true }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,6 @@
- do:
indices.close:
index: index-2
allowed_warnings:
- "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"
- is_true: acknowledged

# closing the index-2 turns the cluster health back to green
Expand Down Expand Up @@ -297,8 +295,6 @@
- do:
indices.close:
index: index-2
allowed_warnings:
- "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"
- is_true: acknowledged

- do:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ setup:
- do:
indices.close:
index: index-2
allowed_warnings:
- "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"

- do:
cluster.health:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ setup:
- do:
indices.close:
index: test_close_index
allowed_warnings:
- "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"

---
"Test expand_wildcards parameter on closed, open indices and both":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ setup:
- do:
indices.close:
index: test_index_3
allowed_warnings:
- "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"

- do:
cluster.health:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,6 @@ setup:
- do:
indices.close:
index: test_index_2
allowed_warnings:
- "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"

- do:
indices.get_alias:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ setup:
- do:
indices.close:
index: test-xyy
allowed_warnings:
- "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"

- do:
cluster.health:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
- do:
indices.close:
index: test_index
allowed_warnings:
- "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"
- is_true: acknowledged

- do:
Expand Down Expand Up @@ -55,8 +53,6 @@
- do:
indices.close:
index: test_index
allowed_warnings:
- "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"
- is_true: acknowledged

- do:
Expand Down Expand Up @@ -113,8 +109,6 @@
- do:
indices.close:
index: "index_*"
allowed_warnings:
- "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"

- match: { acknowledged: true }
- match: { shards_acknowledged: true }
Expand All @@ -123,11 +117,14 @@
- match: { indices.index_3.closed: true }

---
"?wait_for_active_shards=index-setting is deprecated":
"?wait_for_active_shards=index-setting is removed":
- requires:
cluster_features: ["gte_v8.0.0"]
reason: "required deprecation warning is only emitted in 8.0 and later"
test_runner_features: ["warnings"]
reason: "Parameter value 'index-setting' of 'wait-for-active-shards' is rejected with specialised error."
test_runner_features: [capabilities]
capabilities:
- method: POST
path: /{index}/_close
capabilities: [ wait-for-active-shards-index-setting-removed ]

- do:
indices.create:
Expand All @@ -137,8 +134,7 @@
number_of_replicas: 0

- do:
catch: /The 'index-setting' value for parameter 'wait_for_active_shards' is the default behaviour and this configuration value is not supported anymore. Please remove 'wait_for_active_shards=index-setting'/
indices.close:
index: "index_*"
wait_for_active_shards: index-setting
warnings:
- "?wait_for_active_shards=index-setting is now the default behaviour; the 'index-setting' value for this parameter should no longer be used since it will become unsupported in version 9"
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ setup:
- do:
indices.close:
index: _all
allowed_warnings:
- "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"
- is_true: acknowledged

- do:
Expand Down Expand Up @@ -57,8 +55,6 @@ setup:
- do:
indices.close:
index: test_*
allowed_warnings:
- "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"
- is_true: acknowledged

- do:
Expand Down Expand Up @@ -90,8 +86,6 @@ setup:
- do:
indices.close:
index: '*'
allowed_warnings:
- "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"
- is_true: acknowledged

- do:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@ setup:
- do:
indices.close:
index: test-index
allowed_warnings:
- "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"

- do:
indices.put_settings:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@
- do:
indices.close:
index: test_2
allowed_warnings:
- "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"
- is_true: acknowledged

- do:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ setup:
- do:
indices.close:
index: index2
allowed_warnings:
- "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"

---
"Resolve cluster with indices and aliases":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ setup:
- do:
indices.close:
index: test_index2
allowed_warnings:
- "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"

- do:
indices.create:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@
- do:
indices.close:
index: index1
allowed_warnings:
- "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"

- do:
catch: bad_request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
- do:
indices.close:
index: index_closed
allowed_warnings:
- "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"

- do:
catch: /index_closed_exception/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ setup:
- do:
indices.close:
index : test_index
allowed_warnings:
- "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"

- do:
snapshot.restore:
Expand Down Expand Up @@ -92,8 +90,6 @@ setup:
- do:
indices.close:
index : test_index
allowed_warnings:
- "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"

- do:
snapshot.restore:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,6 @@ teardown:
- do:
indices.close:
index : test_index
allowed_warnings:
- "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"

# Restore index
- do:
Expand Down
Loading

0 comments on commit b6345a3

Please sign in to comment.