You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "Pochatkin (via GitHub)" <gi...@apache.org> on 2023/06/06 12:58:20 UTC

[GitHub] [ignite-3] Pochatkin opened a new pull request, #2151: IGNITE-19518 Validate unit after node restart

Pochatkin opened a new pull request, #2151:
URL: https://github.com/apache/ignite-3/pull/2151

   https://issues.apache.org/jira/browse/IGNITE-19518


-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] PakhomovAlexander merged pull request #2151: IGNITE-19518 Validate unit after node restart

Posted by "PakhomovAlexander (via GitHub)" <gi...@apache.org>.
PakhomovAlexander merged PR #2151:
URL: https://github.com/apache/ignite-3/pull/2151


-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] Pochatkin commented on a diff in pull request #2151: IGNITE-19518 Validate unit after node restart

Posted by "Pochatkin (via GitHub)" <gi...@apache.org>.
Pochatkin commented on code in PR #2151:
URL: https://github.com/apache/ignite-3/pull/2151#discussion_r1224337999


##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/ClusterPerTestIntegrationTest.java:
##########
@@ -135,6 +135,10 @@ protected int initialNodes() {
         return 3;
     }
 
+    protected int[] cmgMetastoreNodes() {

Review Comment:
   But this is not only CMG group but metastorage group also.



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] valepakh commented on a diff in pull request #2151: IGNITE-19518 Validate unit after node restart

Posted by "valepakh (via GitHub)" <gi...@apache.org>.
valepakh commented on code in PR #2151:
URL: https://github.com/apache/ignite-3/pull/2151#discussion_r1224502407


##########
modules/code-deployment/src/main/java/org/apache/ignite/internal/deployunit/DownloadTracker.java:
##########
@@ -43,9 +43,9 @@ public class DeployTracker {
      * @param trackableAction Deploy action.
      * @return {@param trackableAction}.
      */
-    public <T> CompletableFuture<T> track(String id, Version version, CompletableFuture<T> trackableAction) {
+    public <T> CompletableFuture<T> track(String id, Version version, Supplier<CompletableFuture<T>> trackableAction) {
         ByteArray key = ClusterStatusKey.builder().id(id).version(version).build().toByteArray();

Review Comment:
   Do we really need to serialize the key to ByteArray here? It's only used as a map key and since ClusterStatusKey has a hashCode/equals implemented, it's perfectly fine to use it directly.



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] PakhomovAlexander commented on a diff in pull request #2151: IGNITE-19518 Validate unit after node restart

Posted by "PakhomovAlexander (via GitHub)" <gi...@apache.org>.
PakhomovAlexander commented on code in PR #2151:
URL: https://github.com/apache/ignite-3/pull/2151#discussion_r1224101496


##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/ClusterPerTestIntegrationTest.java:
##########
@@ -135,6 +135,10 @@ protected int initialNodes() {
         return 3;
     }
 
+    protected int[] cmgMetastoreNodes() {

Review Comment:
   ```suggestion
       protected int[] cmgNodes() {
   ```



##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/Cluster.java:
##########
@@ -119,35 +120,59 @@ public Cluster(TestInfo testInfo, Path workDir, String defaultNodeBootstrapConfi
         this.defaultNodeBootstrapConfigTemplate = defaultNodeBootstrapConfigTemplate;
     }
 
+    public void startAndInit(int nodeCount) {
+        startAndInit(nodeCount, new int[] { 0 });
+    }
+
     /**
      * Starts the cluster with the given number of nodes and initializes it.
      *
      * @param nodeCount Number of nodes in the cluster.
+     * @param cmgNodes Indices of CMG nodes.
      */
-    public void startAndInit(int nodeCount) {
-        startAndInit(nodeCount, builder -> {});
+    public void startAndInit(int nodeCount, int[] cmgNodes) {
+        startAndInit(nodeCount, cmgNodes, builder -> {});
     }
 
     /**
      * Starts the cluster with the given number of nodes and initializes it.
      *
      * @param nodeCount Number of nodes in the cluster.
+     * @param cmgNodes Indices of CMG nodes.
      * @param initParametersConfigurator Configure {@link InitParameters} before initializing the cluster.
      */
-    public void startAndInit(int nodeCount, Consumer<InitParametersBuilder> initParametersConfigurator) {
-        startAndInit(nodeCount, defaultNodeBootstrapConfigTemplate, initParametersConfigurator);
+    public void startAndInit(int nodeCount, int[] cmgNodes, Consumer<InitParametersBuilder> initParametersConfigurator) {
+        startAndInit(nodeCount, cmgNodes, defaultNodeBootstrapConfigTemplate, initParametersConfigurator);
+    }
+
+    /**
+     * Starts the cluster with the given number of nodes and initializes it.

Review Comment:
   Could you mention that the first node will represent a CMG?



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] valepakh commented on a diff in pull request #2151: IGNITE-19518 Validate unit after node restart

Posted by "valepakh (via GitHub)" <gi...@apache.org>.
valepakh commented on code in PR #2151:
URL: https://github.com/apache/ignite-3/pull/2151#discussion_r1224270773


##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/deployment/DeployFiles.java:
##########
@@ -0,0 +1,154 @@
+/*
+ * 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.deployment;
+
+import static org.apache.ignite.internal.rest.api.deployment.DeploymentStatus.DEPLOYED;
+import static org.apache.ignite.internal.testframework.matchers.CompletableFutureMatcher.willBe;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.concurrent.CompletableFuture;
+import java.util.stream.Collectors;
+import org.apache.ignite.compute.version.Version;
+import org.apache.ignite.internal.app.IgniteImpl;
+import org.apache.ignite.internal.deployunit.DeploymentUnit;
+import org.apache.ignite.internal.deployunit.UnitStatuses;
+import org.apache.ignite.internal.deployunit.UnitStatuses.UnitStatusesBuilder;
+
+class DeployFiles {
+    private static final int BASE_REPLICA_TIMEOUT = 30;
+
+    private static final long SMALL_IN_BYTES = 1024L;
+
+    private static final long MEDIUM_IN_BYTES = 1024L * 1024L;
+
+    private static final long BIG_IN_BYTES = 100 * 1024L * 1024L;
+
+    private final Path workDir;
+
+    private final DeployFile smallFile;
+
+    private final DeployFile mediumFile;
+
+    private DeployFile bigFile;
+
+    private final List<DeployFile> allFiles;
+
+    // TODO https://issues.apache.org/jira/browse/IGNITE-19009
+    DeployFiles(Path workDir) throws IOException {
+        this.workDir = workDir;
+        smallFile = create(workDir.resolve("small.txt"), SMALL_IN_BYTES, BASE_REPLICA_TIMEOUT);
+        mediumFile = create(workDir.resolve("medium.txt"), MEDIUM_IN_BYTES, BASE_REPLICA_TIMEOUT * 2);
+        bigFile = create(workDir.resolve("big.txt"), BIG_IN_BYTES, BASE_REPLICA_TIMEOUT * 3);
+        allFiles = List.of(smallFile, mediumFile);
+    }
+
+    private DeployFile create(Path path, long size, int replicaTimeout) throws IOException {
+        DeployFile deployFile = new DeployFile(path, size, replicaTimeout);
+        deployFile.ensureExists();

Review Comment:
   Maybe we could create the file only when it's needed?
   Otherwise 100 MB file will be created before each deployment test even when it's not used.



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org