NSAmelchev 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_r375450576
 
 

 ##########
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
 ##########
 @@ -3949,6 +3957,28 @@ private void checkNearCacheStarted(IgniteCacheProxy<?, 
?> cache) throws IgniteCh
         cluster().active(active);
     }
 
+    /** {@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 || cluster().state() == 
ClusterState.ACTIVE_READ_ONLY)
 
 Review comment:
   I suggest:
   1. Change condition to `cluster().state() != ClusterState.INACTIVE && !force`
   2. Do not execute task. Implement some method like this 
`ctx.state().isCacheDataCanBeLostOnDeactivation()` which will check attributes 
and in-memry caches

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to