Scale up should be successfully completed then only shard rebalancing will start.
As of now the node is getting added and shard rebalancing starts, before the custom role is executed.
Description
OpenSearch scaling manager is starting the OpenSearch while perform a scale out, before the custom role is executed.
If the custom role execution fails then the newly added node will be terminated.
Repetitive failures can create imbalance in cluster, shards may be lost due to termination of instance and cluster can go to unstable state(red).
Steps to reproduce
Simulate rule to Scale out the cluster
Simulate a failure in execution of custom roles.
The node will get added and shard rebalancing will start before execution of custom roles.
Bug Report Checklist
Scale up should be successfully completed then only shard rebalancing will start. As of now the node is getting added and shard rebalancing starts, before the custom role is executed.
Description
OpenSearch scaling manager is starting the OpenSearch while perform a scale out, before the custom role is executed. If the custom role execution fails then the newly added node will be terminated. Repetitive failures can create imbalance in cluster, shards may be lost due to termination of instance and cluster can go to unstable state(red).
Steps to reproduce
Related issues/PRs
https://github.com/maplelabs/opensearch-scaling-manager/pull/511
Suggest a fix
Move the logic of starting the OpenSearch after the custom role execution is successful.