Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
Introduced a new public API for the cluster state change (activation/deactivation and etc.). Added ability to activate clusters in a read-only mode.
-
-
Docs Required, Release Notes Required
Description
We have 3 cluster states at the moment: inactive, active, read-only.
For getting current cluster state and changing them IgniteCluster has methods:
- boolean active(), void active(boolean active) - for cluster activation/deactivation
- boolean readOnly(), void readOnly(boolean readOnly) - for enabling/disabling read-only mode.
Also we have control.sh commans for changing cluster state:
- --activate
- --deactivate
- --read-only-on
- --read-only-off
For me current API looks unuseful. My proposal:
- Create enum ClusterState with values ACTIVE, INACTIVE, READ-ONLY.
- Add methods to IgniteCluster:
- ClusterState state() returns current cluster state
- void state(ClusterState newState) changes cluster state to newState state
- Mark as deprecated the following methods in IgniteCluster: boolean active(), void active(boolean active),
- Add new command to control.sh: control.sh --set-state (ACTIVE|INACTIVE|READ-ONLY) [--yes]
- Add warn message that command is depricated in control.sh. Commands: --activate, --deactivate,
- Remove commands from control.sh: --read-only-on, --read-only-off (no one release wasn't published with this functional)
- Add new methods to IgniteConfiguration:
- ClusterState getClusterStateOnStart()
- IgniteConfiguration setClusterStateOnStart(ClusterState state)
- Deprecate methods in IgniteConfiguration:
- boolean isActiveOnStart()
- IgniteConfiguration setActiveOnStart(boolean activeOnStart)
- Depracate ClusterActivationEvent and introduce new ClusterStateChangeEvent.
Attachments
Issue Links
- causes
-
IGNITE-11719 Document cluster read-only mode
- Resolved
-
IGNITE-13079 Replace deprecated cluster activation methods in tests.
- Open
-
IGNITE-13138 Add REST tests for the new cluster state change API
- Resolved
-
IGNITE-13144 Improve ClusterState enum and other minor improvements for the cluster read-only mode.
- Resolved
- is caused by
-
IGNITE-11256 Implement read-only mode for grid
- Resolved
- is duplicated by
-
IGNITE-11866 Add ability to activate cluster in read-only mode
- Resolved
- links to