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

[GitHub] [ignite-3] denis-chudov opened a new pull request, #2224: IGNITE-17770 ItIgniteNodeRestartTest.testCfgGap is flaky

denis-chudov opened a new pull request, #2224:
URL: https://github.com/apache/ignite-3/pull/2224

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


-- 
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] denis-chudov commented on a diff in pull request #2224: IGNITE-17770 ItIgniteNodeRestartTest.testCfgGap is flaky

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


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/storage/InternalTableImpl.java:
##########
@@ -446,14 +446,16 @@ private <R> CompletableFuture<R> enlistWithRetry(
                                         requestFunction.apply(tx.commitPartition(), primaryReplicaAndTerm.get2())
                                 );
                             } catch (PrimaryReplicaMissException e) {
-                                throw new TransactionException(e);
+                                throw new TransactionException(INTERNAL_ERR, e);

Review Comment:
   I did it just because the constructor with only Throwable as argument is deprecated. Let's remove the error code and rework this later.



-- 
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] sk0x50 merged pull request #2224: IGNITE-17770 ItIgniteNodeRestartTest.testCfgGap is flaky

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


-- 
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] sk0x50 commented on a diff in pull request #2224: IGNITE-17770 ItIgniteNodeRestartTest.testCfgGap is flaky

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


##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgniteNodeRestartTest.java:
##########
@@ -1229,9 +1228,20 @@ private static void checkTableWithData(Ignite ignite, String name) {
         assertNotNull(table);
 
         for (int i = 0; i < 100; i++) {
-            Tuple row = table.keyValueView().get(null, Tuple.create().set("id", i));
+            Tuple row;
 
-            assertEquals(VALUE_PRODUCER.apply(i), row.stringValue("name"));
+            try {
+                row = table.keyValueView().get(null, Tuple.create().set("id", i));
+
+                assertEquals(VALUE_PRODUCER.apply(i), row.stringValue("name"));
+            } catch (TransactionException te) {
+                try {
+                    // There may be an exception if the primary replica node was stopped. We should wait for a new primary to appear.
+                    Thread.sleep(100);

Review Comment:
   Does it mean that we just skip a row and move on to the next one? Is it correct test behavior?



##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/storage/InternalTableImpl.java:
##########
@@ -446,14 +446,16 @@ private <R> CompletableFuture<R> enlistWithRetry(
                                         requestFunction.apply(tx.commitPartition(), primaryReplicaAndTerm.get2())
                                 );
                             } catch (PrimaryReplicaMissException e) {
-                                throw new TransactionException(e);
+                                throw new TransactionException(INTERNAL_ERR, e);

Review Comment:
   It seems to me, that using `TransactionException` with the `INTERNAL_ERR` code is weird. Let's check and rework (if it is needed) our TX exception handling in a separate ticket.



##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/storage/InternalTableImpl.java:
##########
@@ -1268,10 +1270,18 @@ protected CompletableFuture<IgniteBiTuple<ClusterNode, Long>> enlist(int partId,
                 throw new TransactionException(REPLICA_UNAVAILABLE_ERR, "Failed to get the primary replica.");
             }
 
+            String consistentId = primaryPeerAndTerm.leader().consistentId();
+
+            ClusterNode node = clusterNodeResolver.apply(consistentId);
+
+            if (node == null) {
+                throw new TransactionException(REPLICA_UNAVAILABLE_ERR, "Failed to resolve the primary replica node, consistentId="

Review Comment:
   I would change the error message a bit: `Failed to resolve the primary replica node [consistentId=" + consistentId + ']`



-- 
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] denis-chudov commented on a diff in pull request #2224: IGNITE-17770 ItIgniteNodeRestartTest.testCfgGap is flaky

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


##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgniteNodeRestartTest.java:
##########
@@ -1229,9 +1228,20 @@ private static void checkTableWithData(Ignite ignite, String name) {
         assertNotNull(table);
 
         for (int i = 0; i < 100; i++) {
-            Tuple row = table.keyValueView().get(null, Tuple.create().set("id", i));
+            Tuple row;
 
-            assertEquals(VALUE_PRODUCER.apply(i), row.stringValue("name"));
+            try {
+                row = table.keyValueView().get(null, Tuple.create().set("id", i));
+
+                assertEquals(VALUE_PRODUCER.apply(i), row.stringValue("name"));
+            } catch (TransactionException te) {
+                try {
+                    // There may be an exception if the primary replica node was stopped. We should wait for a new primary to appear.
+                    Thread.sleep(100);

Review Comment:
   My bad, missed retry code.



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