anton-vinogradov commented on code in PR #9907:
URL: https://github.com/apache/ignite/pull/9907#discussion_r880639434
##########
modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/consistency/ConsistencyCommand.java:
##########
@@ -184,6 +217,11 @@ public class ConsistencyCommand extends
AbstractCommand<Object> {
if (strategy == null)
throw new IllegalArgumentException("Strategy argument
missed.");
+ // see https://issues.apache.org/jira/browse/IGNITE-15316
+ if (parallel && strategy != ReadRepairStrategy.CHECK_ONLY)
Review Comment:
What should be changed?
##########
modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/consistency/ConsistencyCommand.java:
##########
@@ -52,43 +57,64 @@ public class ConsistencyCommand extends
AbstractCommand<Object> {
/** Strategy. */
public static final String STRATEGY = "--strategy";
+ /** Parallel check. */
+ public static final String PARALLEL = "--parallel";
+
/** Command argument. */
private VisorConsistencyRepairTaskArg cmdArg;
/** Consistency sub-command to execute. */
private ConsistencySubCommand cmd;
+ /** Parallel check.*/
+ private boolean parallel;
+
+ /** Predicate to filter server nodes. */
+ private static final Predicate<GridClientNode> SRV_NODES = node ->
!node.isClient() && !node.isDaemon();
+
/** {@inheritDoc} */
@Override public Object execute(GridClientConfiguration clientCfg, Logger
log) throws Exception {
boolean failed = false;
StringBuilder sb = new StringBuilder();
try (GridClient client = Command.startClient(clientCfg)) {
- VisorConsistencyTaskResult res = executeTaskByNameOnNode(
- client,
- cmd.taskName(),
- arg(),
- BROADCAST_UUID,
- clientCfg
- );
-
- if (res.cancelled()) {
- sb.append("Operation execution cancelled.\n\n");
-
- failed = true;
- }
+ Set<UUID> nodeIds = parallel ?
Review Comment:
What should be changed?
##########
modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerConsistencyRepairCorrectnessTransactionalTest.java:
##########
@@ -0,0 +1,256 @@
+/*
+ * 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.util;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.ReadRepairStrategy;
+import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.commandline.consistency.ConsistencyCommand;
+import
org.apache.ignite.internal.processors.cache.consistency.ReadRepairDataGenerator;
+import
org.apache.ignite.internal.processors.cache.consistency.ReadRepairDataGenerator.InconsistentMapping;
+import
org.apache.ignite.internal.processors.cache.consistency.ReadRepairDataGenerator.ReadRepairData;
+import org.apache.ignite.internal.util.typedef.G;
+import org.apache.ignite.testframework.ListeningTestLogger;
+import org.apache.ignite.testframework.junits.WithSystemProperty;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import static
org.apache.ignite.IgniteSystemProperties.IGNITE_ENABLE_EXPERIMENTAL_COMMAND;
+import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
+import static
org.apache.ignite.internal.commandline.CommandHandler.EXIT_CODE_OK;
+
+/**
+ *
+ */
+@RunWith(Parameterized.class)
+@WithSystemProperty(key = IGNITE_ENABLE_EXPERIMENTAL_COMMAND, value = "true")
+public class GridCommandHandlerConsistencyRepairCorrectnessTransactionalTest
extends GridCommandHandlerAbstractTest {
+ /** Test parameters. */
+ @Parameterized.Parameters(name = "misses={0}, nulls={1}, strategy={2},
parallel={3}")
+ public static Iterable<Object[]> parameters() {
+ List<Object[]> res = new ArrayList<>();
+
+ for (boolean misses : new boolean[] {false, true}) {
+ for (boolean nulls : new boolean[] {false, true})
Review Comment:
What should be changed?
--
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]