IGNITE-28731 Create cluster auto activation plugin - #355
Conversation
| if (cluster.state() == ClusterState.ACTIVE) { | ||
| if (logger.isInfoEnabled()) | ||
| logger.info("Auto activation skipped - cluster already activated"); | ||
|
|
||
| return; | ||
| } | ||
|
|
||
| if (cluster.currentBaselineTopology() != null) { | ||
| if (logger.isInfoEnabled()) | ||
| logger.info("Auto activation skipped - baseline is not empty"); | ||
|
|
||
| return; | ||
| } | ||
|
|
||
| if (condition.apply(cluster.nodes())) { | ||
| if (logger.isInfoEnabled()) | ||
| logger.info("Auto activation plugin set cluster state ACTIVE - activation condition meet"); | ||
|
|
||
| cluster.state(ClusterState.ACTIVE); | ||
| } | ||
| else { | ||
| if (logger.isInfoEnabled()) | ||
| logger.info("Auto activation skipped - activation condition not meet"); | ||
| } |
There was a problem hiding this comment.
Should ACTIVE_READ_ONLY be treated as already activated here? With the current check the plugin skips only ACTIVE and later calls cluster.state(ACTIVE), so a read-only cluster can be promoted to read-write mode by auto-activation. I think auto-activation should only activate INACTIVE clusters and leave ACTIVE_READ_ONLY unchanged.
Also add test for ACTIVE_READ_ONLY nodes
| return; | ||
| } | ||
|
|
||
| if (condition.apply(cluster.nodes())) { |
There was a problem hiding this comment.
Should this condition be evaluated only against server nodes? cluster.nodes() includes client nodes, so a client node with a matching consistentId or attribute can satisfy the activation condition and trigger cluster activation before the required server topology is actually present
WDYT?
There was a problem hiding this comment.
Also add test for scenario with client nodes
| @@ -0,0 +1,113 @@ | |||
| <beans xmlns="http://www.springframework.org/schema/beans" | |||
There was a problem hiding this comment.
These XML test configs duplicate most of the Ignite configuration. Can we move the common storage/cache/discovery/connector settings to a shared parent bean or common XML file, and keep only node-specific values here?
No description provided.