Vladsz83 commented on a change in pull request #7358: IGNITE-12614 : Disallow 
silent deactivation of cluster to prevent in-mem data loss.
URL: https://github.com/apache/ignite/pull/7358#discussion_r375359487
 
 

 ##########
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
 ##########
 @@ -3946,7 +3952,27 @@ private void checkNearCacheStarted(IgniteCacheProxy<?, 
?> cache) throws IgniteCh
 
     /** {@inheritDoc} */
     @Override public void active(boolean active) {
-        cluster().active(active);
+        if (active)
+            activate();
+        else
+            deactivate(false);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void activate() {
+        cluster().state(ClusterState.ACTIVE);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void deactivate(boolean force) {
+        //Check if cluster ir ready for deactivation.
+        if (cluster().state() == ClusterState.ACTIVE && !force) {
+            String msg = 
ClusterStateChangeCommand.isClusterReadyForDeactivation((cls -> 
compute().execute(cls, null)));
 
 Review comment:
   Implemented.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to