Skip to content

Commit

Permalink
Add request parameter 'cluster_manager_timeout' and deprecate 'master…
Browse files Browse the repository at this point in the history
…_timeout' - in Index APIs except index template APIs (#2660)

- Deprecate the request parameter `master_timeout` that used in Index APIs which have got the parameter. 
(except index template APIs, which is addressed in PR #2678) 
- Add alternative new request parameter `cluster_manager_timeout`.
- Add unit tests.

Signed-off-by: Tianli Feng <[email protected]>
  • Loading branch information
Tianli Feng authored Apr 5, 2022
1 parent 0b1f4a2 commit 7aa496f
Show file tree
Hide file tree
Showing 46 changed files with 489 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public void testDanglingIndicesCanBeImported() throws Exception {
importRequest.addParameter("accept_data_loss", "true");
// Ensure this parameter is accepted
importRequest.addParameter("timeout", "20s");
importRequest.addParameter("master_timeout", "20s");
importRequest.addParameter("cluster_manager_timeout", "20s");
final Response importResponse = restClient.performRequest(importRequest);
assertThat(importResponse.getStatusLine().getStatusCode(), equalTo(ACCEPTED.getStatus()));

Expand Down Expand Up @@ -171,7 +171,7 @@ public void testDanglingIndicesCanBeDeleted() throws Exception {
deleteRequest.addParameter("accept_data_loss", "true");
// Ensure these parameters is accepted
deleteRequest.addParameter("timeout", "20s");
deleteRequest.addParameter("master_timeout", "20s");
deleteRequest.addParameter("cluster_manager_timeout", "20s");
final Response deleteResponse = restClient.performRequest(deleteRequest);
assertThat(deleteResponse.getStatusLine().getStatusCode(), equalTo(ACCEPTED.getStatus()));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,17 @@
"type": "time",
"description": "Explicit operation timeout"
},
"master_timeout": {
"type": "time",
"description": "Specify timeout for connection to master"
"master_timeout":{
"type":"time",
"description":"Specify timeout for connection to master",
"deprecated":{
"version":"2.0.0",
"description":"To promote inclusive language, use 'cluster_manager_timeout' instead."
}
},
"cluster_manager_timeout":{
"type":"time",
"description":"Specify timeout for connection to cluster-manager node"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,17 @@
"type": "time",
"description": "Explicit operation timeout"
},
"master_timeout": {
"type": "time",
"description": "Specify timeout for connection to master"
"master_timeout":{
"type":"time",
"description":"Specify timeout for connection to master",
"deprecated":{
"version":"2.0.0",
"description":"To promote inclusive language, use 'cluster_manager_timeout' instead."
}
},
"cluster_manager_timeout":{
"type":"time",
"description":"Specify timeout for connection to cluster-manager node"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,15 @@
},
"master_timeout":{
"type":"time",
"description":"Specify timeout for connection to master"
"description":"Specify timeout for connection to master",
"deprecated":{
"version":"2.0.0",
"description":"To promote inclusive language, use 'cluster_manager_timeout' instead."
}
},
"cluster_manager_timeout":{
"type":"time",
"description":"Specify timeout for connection to cluster-manager node"
},
"ignore_unavailable":{
"type":"boolean",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,17 @@
"type" : "time",
"description" : "Explicit operation timeout"
},
"master_timeout": {
"type" : "time",
"description" : "Specify timeout for connection to master"
"master_timeout":{
"type":"time",
"description":"Specify timeout for connection to master",
"deprecated":{
"version":"2.0.0",
"description":"To promote inclusive language, use 'cluster_manager_timeout' instead."
}
},
"cluster_manager_timeout":{
"type":"time",
"description":"Specify timeout for connection to cluster-manager node"
},
"wait_for_active_shards": {
"type" : "string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,15 @@
},
"master_timeout":{
"type":"time",
"description":"Specify timeout for connection to master"
"description":"Specify timeout for connection to master",
"deprecated":{
"version":"2.0.0",
"description":"To promote inclusive language, use 'cluster_manager_timeout' instead."
}
},
"cluster_manager_timeout":{
"type":"time",
"description":"Specify timeout for connection to cluster-manager node"
},
"ignore_unavailable":{
"type":"boolean",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,15 @@
},
"master_timeout":{
"type":"time",
"description":"Specify timeout for connection to master"
"description":"Specify timeout for connection to master",
"deprecated":{
"version":"2.0.0",
"description":"To promote inclusive language, use 'cluster_manager_timeout' instead."
}
},
"cluster_manager_timeout":{
"type":"time",
"description":"Specify timeout for connection to cluster-manager node"
}
},
"body":{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,15 @@
},
"master_timeout":{
"type":"time",
"description":"Specify timeout for connection to master"
"description":"Specify timeout for connection to master",
"deprecated":{
"version":"2.0.0",
"description":"To promote inclusive language, use 'cluster_manager_timeout' instead."
}
},
"cluster_manager_timeout":{
"type":"time",
"description":"Specify timeout for connection to cluster-manager node"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,15 @@
},
"master_timeout":{
"type":"time",
"description":"Specify timeout for connection to master"
"description":"Specify timeout for connection to master",
"deprecated":{
"version":"2.0.0",
"description":"To promote inclusive language, use 'cluster_manager_timeout' instead."
}
},
"cluster_manager_timeout":{
"type":"time",
"description":"Specify timeout for connection to cluster-manager node"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,15 @@
},
"master_timeout":{
"type":"time",
"description":"Specify timeout for connection to master"
"description":"Specify timeout for connection to master",
"deprecated":{
"version":"2.0.0",
"description":"To promote inclusive language, use 'cluster_manager_timeout' instead."
}
},
"cluster_manager_timeout":{
"type":"time",
"description":"Specify timeout for connection to cluster-manager node"
},
"local":{
"type":"boolean",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,15 @@
"params":{
"master_timeout":{
"type":"time",
"description":"Specify timeout for connection to master"
"description":"Specify timeout for connection to master",
"deprecated":{
"version":"2.0.0",
"description":"To promote inclusive language, use 'cluster_manager_timeout' instead."
}
},
"cluster_manager_timeout":{
"type":"time",
"description":"Specify timeout for connection to cluster-manager node"
},
"ignore_unavailable":{
"type":"boolean",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,15 @@
},
"master_timeout":{
"type":"time",
"description":"Explicit operation timeout for connection to master node"
"description":"Explicit operation timeout for connection to master node",
"deprecated":{
"version":"2.0.0",
"description":"To promote inclusive language, use 'cluster_manager_timeout' instead."
}
},
"cluster_manager_timeout":{
"type":"time",
"description":"Explicit operation timeout for connection to cluster-manager node"
},
"local":{
"type":"boolean",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,15 @@
},
"master_timeout":{
"type":"time",
"description":"Specify timeout for connection to master"
"description":"Specify timeout for connection to master",
"deprecated":{
"version":"2.0.0",
"description":"To promote inclusive language, use 'cluster_manager_timeout' instead."
}
},
"cluster_manager_timeout":{
"type":"time",
"description":"Specify timeout for connection to cluster-manager node"
}
},
"body":{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,15 @@
},
"master_timeout":{
"type":"time",
"description":"Specify timeout for connection to master"
"description":"Specify timeout for connection to master",
"deprecated":{
"version":"2.0.0",
"description":"To promote inclusive language, use 'cluster_manager_timeout' instead."
}
},
"cluster_manager_timeout":{
"type":"time",
"description":"Specify timeout for connection to cluster-manager node"
},
"ignore_unavailable":{
"type":"boolean",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,15 @@
"params":{
"master_timeout":{
"type":"time",
"description":"Specify timeout for connection to master"
"description":"Specify timeout for connection to master",
"deprecated":{
"version":"2.0.0",
"description":"To promote inclusive language, use 'cluster_manager_timeout' instead."
}
},
"cluster_manager_timeout":{
"type":"time",
"description":"Specify timeout for connection to cluster-manager node"
},
"timeout":{
"type":"time",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,15 @@
},
"master_timeout":{
"type":"time",
"description":"Specify timeout for connection to master"
"description":"Specify timeout for connection to master",
"deprecated":{
"version":"2.0.0",
"description":"To promote inclusive language, use 'cluster_manager_timeout' instead."
}
},
"cluster_manager_timeout":{
"type":"time",
"description":"Specify timeout for connection to cluster-manager node"
},
"wait_for_active_shards":{
"type":"string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,17 @@
"type" : "time",
"description" : "Explicit operation timeout"
},
"master_timeout": {
"type" : "time",
"description" : "Specify timeout for connection to master"
"master_timeout":{
"type":"time",
"description":"Specify timeout for connection to master",
"deprecated":{
"version":"2.0.0",
"description":"To promote inclusive language, use 'cluster_manager_timeout' instead."
}
},
"cluster_manager_timeout":{
"type":"time",
"description":"Specify timeout for connection to cluster-manager node"
},
"wait_for_active_shards": {
"type" : "string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,17 @@
"type" : "time",
"description" : "Explicit operation timeout"
},
"master_timeout": {
"type" : "time",
"description" : "Specify timeout for connection to master"
"master_timeout":{
"type":"time",
"description":"Specify timeout for connection to master",
"deprecated":{
"version":"2.0.0",
"description":"To promote inclusive language, use 'cluster_manager_timeout' instead."
}
},
"cluster_manager_timeout":{
"type":"time",
"description":"Specify timeout for connection to cluster-manager node"
},
"wait_for_active_shards": {
"type" : "string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,15 @@
},
"master_timeout":{
"type":"time",
"description":"Specify timeout for connection to master"
"description":"Specify timeout for connection to master",
"deprecated":{
"version":"2.0.0",
"description":"To promote inclusive language, use 'cluster_manager_timeout' instead."
}
},
"cluster_manager_timeout":{
"type":"time",
"description":"Specify timeout for connection to cluster-manager node"
}
},
"body":{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ setup:
- skip:
version: " - 7.3.99"
reason: index cloning was added in 7.4.0
features: allowed_warnings
# make it read-only
- do:
indices.put_settings:
Expand All @@ -46,6 +47,8 @@ setup:

# now we do the actual clone
- do:
allowed_warnings:
- "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version."
indices.clone:
index: "source"
target: "target"
Expand Down Expand Up @@ -94,9 +97,12 @@ setup:
- skip:
version: " - 7.3.99"
reason: index cloning was added in 7.4.0
features: allowed_warnings
# try to do an illegal clone with illegal number_of_shards
- do:
catch: /illegal_argument_exception/
allowed_warnings:
- "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version."
indices.clone:
index: "source"
target: "target"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- skip:
version: " - 7.3.99"
reason: index cloning was added in 7.4.0
features: allowed_warnings
# create index
- do:
indices.create:
Expand Down Expand Up @@ -50,6 +51,8 @@

# now we do the actual clone
- do:
allowed_warnings:
- "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version."
indices.clone:
index: "source"
target: "target"
Expand Down
Loading

0 comments on commit 7aa496f

Please sign in to comment.