-
Notifications
You must be signed in to change notification settings - Fork 24.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Transform] Enhance transform role checks (#70139)
improve robustness and ux in case of a missing transform node: - warn if cluster lacks a transform node in all API's (except DELETE) - report waiting state in stats if transform waits for assignment - cancel p-task on stop transform even if config has been deleted relates #69518
- Loading branch information
Hendrik Muhs
authored
Mar 10, 2021
1 parent
ff50da5
commit 61f0c47
Showing
16 changed files
with
391 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...erTest/java/org/elasticsearch/xpack/transform/integration/TransformNoTransformNodeIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
package org.elasticsearch.xpack.transform.integration; | ||
|
||
import org.elasticsearch.common.settings.Settings; | ||
import org.elasticsearch.node.NodeRoleSettings; | ||
import org.elasticsearch.xpack.core.transform.action.GetTransformAction; | ||
import org.elasticsearch.xpack.core.transform.action.GetTransformStatsAction; | ||
import org.elasticsearch.xpack.transform.TransformSingleNodeTestCase; | ||
|
||
public class TransformNoTransformNodeIT extends TransformSingleNodeTestCase { | ||
@Override | ||
protected Settings nodeSettings() { | ||
return Settings.builder().put(NodeRoleSettings.NODE_ROLES_SETTING.getKey(), "master, data, ingest").build(); | ||
} | ||
|
||
public void testWarningForStats() { | ||
GetTransformStatsAction.Request getTransformStatsRequest = new GetTransformStatsAction.Request("_all"); | ||
GetTransformStatsAction.Response getTransformStatsResponse = client().execute( | ||
GetTransformStatsAction.INSTANCE, | ||
getTransformStatsRequest | ||
).actionGet(); | ||
|
||
assertEquals(0, getTransformStatsResponse.getTransformsStats().size()); | ||
|
||
assertWarnings("Transform requires the transform node role for at least 1 node, found no transform nodes"); | ||
} | ||
|
||
public void testWarningForGet() { | ||
GetTransformAction.Request getTransformRequest = new GetTransformAction.Request("_all"); | ||
GetTransformAction.Response getTransformResponse = client().execute(GetTransformAction.INSTANCE, getTransformRequest).actionGet(); | ||
assertEquals(0, getTransformResponse.getTransformConfigurations().size()); | ||
|
||
assertWarnings("Transform requires the transform node role for at least 1 node, found no transform nodes"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.