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

Remove support for wait_for_active_shards=index-setting in index close API #114709

Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
a74b605
Remove support for wait_for_active_shards=index-setting in index clos…
arteam Oct 14, 2024
f61f16e
Update docs/changelog/114709.yaml
arteam Oct 14, 2024
21dbde6
Log compatible critical deprecation warnings in V8 compatibility mode
arteam Oct 14, 2024
aef7c73
Merge remote-tracking branch 'origin/main' into remove-support-wait-f…
arteam Oct 14, 2024
d92690c
Describe the breaking change
arteam Oct 14, 2024
f7e4c69
Use CRUD as the area
arteam Oct 14, 2024
5fa248d
Fix correct are for breaking changes
arteam Oct 14, 2024
a256605
Verify wait_for_active_shards=index-setting returns a 400 error
arteam Oct 15, 2024
9c48586
Add a match for the error
arteam Oct 15, 2024
90a0b49
Merge remote-tracking branch 'origin/main' into remove-support-wait-f…
arteam Oct 15, 2024
a124149
Ignore indices.open/10_basic/?wait_for_active_shards=index-setting test
arteam Oct 15, 2024
dae8d5f
Fix skipTest signature
arteam Oct 15, 2024
9300420
Merge remote-tracking branch 'origin/main' into remove-support-wait-f…
arteam Oct 15, 2024
311a978
Delete docs/changelog/114709.yaml
arteam Oct 17, 2024
2f8aa73
Update docs/changelog/114709.yaml
arteam Oct 17, 2024
2ee4c1b
Update changelog
arteam Oct 17, 2024
3321d9d
Merge branch 'main' into remove-support-wait-for-active-shards-index-…
elasticmachine Oct 17, 2024
1316de6
Merge remote-tracking branch 'origin/main' into remove-support-wait-f…
arteam Oct 24, 2024
3621674
Merge remote-tracking branch 'origin/main' into remove-support-wait-f…
arteam Oct 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/changelog/114709.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
pr: 114709
summary: Remove support for wait_for_active_shards=index-setting in index close API
area: Distributed
type: breaking
issues: []
breaking:
title: Remove support for wait_for_active_shards=index-setting in index close API
area: Distributed
details: Please describe the details of this change for the release notes. You can
use asciidoc.
impact: Please describe the impact of this change to users
notable: false
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@
- 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,7 @@ 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,7 @@ 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,7 @@
- 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,7 @@
- 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,7 @@
- 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 +424,7 @@
- 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,7 @@
- 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 +131,7 @@
- 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 +276,7 @@
- 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,7 @@
- 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,7 @@
- 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,7 @@
- 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,7 @@
- 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 +296,7 @@
- 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,7 @@ 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,7 @@ 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,7 @@ 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 @@ -312,8 +312,7 @@ 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,7 @@ 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,7 @@
- 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 +54,7 @@
- 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 +111,7 @@
- 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 Down
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,7 @@ 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 +87,7 @@ 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,7 @@ 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,7 @@
- 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,7 @@ 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,7 @@ 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,7 @@
- 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,7 @@
- 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,7 @@ 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 +91,7 @@ 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,7 @@ 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
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@

package org.elasticsearch.rest.action.admin.indices;

import org.elasticsearch.Version;
import org.elasticsearch.action.admin.indices.close.CloseIndexRequest;
import org.elasticsearch.action.support.ActiveShardCount;
import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.client.internal.node.NodeClient;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.logging.DeprecationCategory;
import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.core.UpdateForV9;
import org.elasticsearch.rest.BaseRestHandler;
Expand Down Expand Up @@ -55,16 +53,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC
closeIndexRequest.indicesOptions(IndicesOptions.fromRequest(request, closeIndexRequest.indicesOptions()));
String waitForActiveShards = request.param("wait_for_active_shards");
if ("index-setting".equalsIgnoreCase(waitForActiveShards)) {
deprecationLogger.warn(
DeprecationCategory.SETTINGS,
"close-index-wait_for_active_shards-index-setting",
"?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 "
+ (Version.V_8_0_0.major + 1)
);
// TODO in v9:
// - throw an IllegalArgumentException here
// - record the removal of support for this value as a breaking change
throw new IllegalArgumentException("wait_for_active_shards=index-setting shouldn't be used");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to preserve the v8 behaviour here still if RestApiVersion.V_8 is specified.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, just saw a comment about that in the dev issue 👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 that applies to all other similar breaking changes too btw

// TODO in v10:
// - remove the IllegalArgumentException here
} else if (waitForActiveShards != null) {
Expand Down
Loading