timoninmaxim commented on a change in pull request #9529:
URL: https://github.com/apache/ignite/pull/9529#discussion_r741870181
##########
File path:
modules/core/src/main/java/org/apache/ignite/internal/visor/consistency/VisorConsistencyRepairTaskArg.java
##########
@@ -77,4 +78,19 @@ public String cacheName() {
public int part() {
return part;
}
+
+ /** {@inheritDoc} */
+ @Override public boolean equals(Object o) {
+ if (this == o)
+ return true;
+ if (o == null || getClass() != o.getClass())
Review comment:
Format code with Ignite guidelines (add few empty lines).
##########
File path:
modules/core/src/main/java/org/apache/ignite/internal/visor/consistency/VisorConsistencyRepairTask.java
##########
@@ -198,6 +162,8 @@ protected
VisorConsistencyRepairJob(VisorConsistencyRepairTaskArg arg, boolean d
log.info("Consistency check progress [grp=" +
grpCtx.cacheOrGroupName() +
", part=" + p + ", checked=" + cnt + "/" +
part.fullSize() + "]");
+
+ VisorConsistencyStatusTask.MAP.put(arg, cnt + "/"
+ part.fullSize());
Review comment:
Should the map also be notified a little bit earlier? See line 114 with
logging "Consistency check started"? I think we should put to the map (arg,
0/part.fullSize()) in this moment, WDYT?
Otherwise the status job may return that no repair jobs are found, but
actually there are in progress.
##########
File path:
modules/core/src/main/java/org/apache/ignite/internal/visor/consistency/VisorConsistencyStatusTask.java
##########
@@ -0,0 +1,97 @@
+/*
+ * 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.visor.consistency;
+
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.IgniteLogger;
+import org.apache.ignite.compute.ComputeJobResult;
+import org.apache.ignite.internal.visor.VisorJob;
+import org.apache.ignite.resources.LoggerResource;
+
+/**
+ *
+ */
+public class VisorConsistencyStatusTask extends AbstractConsistencyTask<Void,
String> {
+ /**
+ * Serial version uid.
+ */
Review comment:
Too much honor for `serialVersionUID` - 3 comment lines instead of 1 as
for others fields
##########
File path:
modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/consistency/ConsistencyCommand.java
##########
@@ -96,7 +98,7 @@
}
/** {@inheritDoc} */
- @Override public VisorConsistencyRepairTaskArg arg() {
+ @Override public Object arg() {
Review comment:
Looks like we don't need this change?
##########
File path:
modules/control-utility/src/test/java/org/apache/ignite/util/KillCommandsCommandShTest.java
##########
@@ -271,16 +287,25 @@ public void testCancelConsistencyTask() throws
InterruptedException {
thLatch.countDown();
});
+ // GridNearGetRequest messages count required to pefrom getAll() with
readRepair from all nodes twice.
+ // First will be finished (which generates status), second will be
frozen.
+ int twiceGetMsgCnt = SERVER_NODE_CNT * (SERVER_NODE_CNT - 1) * 2;
Review comment:
Looks like this test can be simplified. If the consistency status map
will be notified on the repair task just started then we just "0/10000" instead
of "1024/10000"). So, there is no need to implement complex logic for waiting
specific events? WDYT?
##########
File path:
modules/control-utility/src/test/java/org/apache/ignite/util/KillCommandsCommandShTest.java
##########
@@ -228,10 +231,14 @@ public void testCancelConsistencyTask() throws
InterruptedException {
cfg.setName(consistencyCancheName);
cfg.setBackups(SERVER_NODE_CNT - 1);
+ cfg.setCacheMode(CacheMode.REPLICATED);
Review comment:
This test passes with partitioned cache too. Why do we need set
replicated here?
--
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]