mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-25 09:28:27 +00:00
[TEST] Wait for replicas to be allocated before shrinking
The full-cluster-restart tests are run with two nodes. This can lead to situations where the shrink tests fail because the replicas are not allocated yet and the shrink operation needs the source shards to be available on the same node.
This commit is contained in:
parent
db186311c6
commit
ae9c3281fc
@ -388,6 +388,8 @@ public class FullClusterRestartIT extends ESRestTestCase {
|
||||
.endObject();
|
||||
});
|
||||
|
||||
ensureGreen(index); // wait for source index to be available on both nodes before starting shrink
|
||||
|
||||
String updateSettingsRequestBody = "{\"settings\": {\"index.blocks.write\": true}}";
|
||||
Response rsp = client().performRequest("PUT", "/" + index + "/_settings", Collections.emptyMap(),
|
||||
new StringEntity(updateSettingsRequestBody, ContentType.APPLICATION_JSON));
|
||||
@ -453,6 +455,8 @@ public class FullClusterRestartIT extends ESRestTestCase {
|
||||
.endObject();
|
||||
});
|
||||
} else {
|
||||
ensureGreen(index); // wait for source index to be available on both nodes before starting shrink
|
||||
|
||||
String updateSettingsRequestBody = "{\"settings\": {\"index.blocks.write\": true}}";
|
||||
Response rsp = client().performRequest("PUT", "/" + index + "/_settings", Collections.emptyMap(),
|
||||
new StringEntity(updateSettingsRequestBody, ContentType.APPLICATION_JSON));
|
||||
|
Loading…
x
Reference in New Issue
Block a user