ibessonov commented on code in PR #1597:
URL: https://github.com/apache/ignite-3/pull/1597#discussion_r1090555279


##########
modules/cluster-management/src/main/java/org/apache/ignite/internal/cluster/management/ClusterManagementGroupManager.java:
##########
@@ -188,6 +193,8 @@ public void initCluster(
 
     @Override
     public void start() {
+        networkInvokeTimeoutMillis = 
configuration.networkInvokeTimeout().value();

Review Comment:
   Do we want it to be dynamically-updated? If we do, then we should read it 
from the configuration every time



##########
modules/cluster-management/src/main/java/org/apache/ignite/internal/cluster/management/ClusterManagementGroupManager.java:
##########
@@ -597,14 +604,13 @@ public void onDisappeared(ClusterNode member) {
     }
 
     private void scheduleRemoveFromLogicalTopology(CmgRaftService raftService, 
ClusterNode node) {
-        // TODO: delay should be configurable, see 
https://issues.apache.org/jira/browse/IGNITE-16785
         scheduledExecutor.schedule(() -> {
             ClusterNode physicalTopologyNode = 
clusterService.topologyService().getByConsistentId(node.name());
 
             if (physicalTopologyNode == null || 
!physicalTopologyNode.id().equals(node.id())) {
                 raftService.removeFromCluster(Set.of(node));
             }
-        }, 0, TimeUnit.MILLISECONDS);
+        }, 
configuration.logicalTopologyRemovalDelayAfterDisappearance().value(), 
TimeUnit.MILLISECONDS);

Review Comment:
   Configuration names this long might now be user-friendly. Some day we should 
revisit all names. Also, should this be a top-level configuration property, or 
maybe nested inside of some sub-configuration?
   
   Anyway, name is too specific, user should not know what a disappearance. In 
Ignite 2 we called it a "failover timeout" if I remember correctly. We can 
discuss other options as well



##########
modules/cluster-management/src/main/java/org/apache/ignite/internal/cluster/management/configuration/ClusterManagementConfigurationModule.java:
##########
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.cluster.management.configuration;
+
+import com.google.auto.service.AutoService;
+import java.util.Collection;
+import java.util.List;
+import org.apache.ignite.configuration.RootKey;
+import org.apache.ignite.configuration.annotation.ConfigurationType;
+import org.apache.ignite.internal.configuration.ConfigurationModule;
+
+/**
+ * Configuration module for Cluster Management configs.
+ */
+@AutoService(ConfigurationModule.class)
+public class ClusterManagementConfigurationModule implements 
ConfigurationModule {
+    @Override
+    public ConfigurationType type() {
+        return ConfigurationType.LOCAL;
+    }
+
+    @Override
+    public Collection<RootKey<?, ?>> rootKeys() {
+        return List.of(ClusterManagementConfiguration.KEY);

Review Comment:
   So, cluster management configuration is a local configuration. Is that 
expected, or is it a mistake?



##########
modules/cluster-management/src/main/java/org/apache/ignite/internal/cluster/management/configuration/ClusterManagementConfigurationSchema.java:
##########
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.cluster.management.configuration;
+
+import java.util.concurrent.TimeUnit;
+import org.apache.ignite.configuration.annotation.ConfigurationRoot;
+import org.apache.ignite.configuration.annotation.ConfigurationType;
+import org.apache.ignite.configuration.annotation.Value;
+
+/**
+ * Cluster management configuration schema.
+ */
+@ConfigurationRoot(rootName = "cluster", type = ConfigurationType.LOCAL)
+public class ClusterManagementConfigurationSchema {
+    /** Invoke timeout used by Cluster Management module (ms). */
+    @Value(hasDefault = true)
+    public long networkInvokeTimeout = 500;

Review Comment:
   Please ask `@Range(...)` with adequate values for validation



##########
modules/cluster-management/src/main/java/org/apache/ignite/internal/cluster/management/configuration/ClusterManagementConfigurationSchema.java:
##########
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.cluster.management.configuration;
+
+import java.util.concurrent.TimeUnit;
+import org.apache.ignite.configuration.annotation.ConfigurationRoot;
+import org.apache.ignite.configuration.annotation.ConfigurationType;
+import org.apache.ignite.configuration.annotation.Value;
+
+/**
+ * Cluster management configuration schema.
+ */
+@ConfigurationRoot(rootName = "cluster", type = ConfigurationType.LOCAL)
+public class ClusterManagementConfigurationSchema {
+    /** Invoke timeout used by Cluster Management module (ms). */
+    @Value(hasDefault = true)
+    public long networkInvokeTimeout = 500;
+
+    /**
+     * Delay between a moment a node drops out from the physical topology and 
when it gets removed from the logical topology (ms).
+     */
+    @Value(hasDefault = true)
+    public long logicalTopologyRemovalDelayAfterDisappearance = 0;

Review Comment:
   So, we remove node immediately. There should be a TODO here I guess, this 
value must be changed to something better in the nearest future



##########
modules/runner/src/main/java/org/apache/ignite/internal/app/IgniteImpl.java:
##########
@@ -332,7 +333,8 @@ public class IgniteImpl implements Ignite {
                 clusterSvc,
                 raftMgr,
                 clusterStateStorage,
-                logicalTopology
+                logicalTopology,
+                
nodeCfgMgr.configurationRegistry().getConfiguration(ClusterManagementConfiguration.KEY)

Review Comment:
   Don't we have a variable that's equal to 
`nodeCfgMgr.configurationRegistry()`? Please check



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to