skorotkov commented on code in PR #10178:
URL: https://github.com/apache/ignite/pull/10178#discussion_r941442336
##########
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxRecoveryWithConcurrentRollbackTest.java:
##########
@@ -258,6 +263,120 @@ else if (g1Keys.contains(key))
assertEquals(s1, s2);
}
+ /**
+ * The test enforces the concurrent processing of the same prepared
transaction
+ * both in the tx recovery procedure started due to primary node left and
in the
+ * tx recovery request handler invoked by message from another backup node.
+ * <p>
+ * The idea is to have a 3-nodes cluster and a cache with 2 backups. So
there
+ * will be 2 backup nodes to execute the tx recovery in parallel if
primary one
+ * would fail. These backup nodes will send the tx recovery requests to
each
+ * other, so the tx recovery request handler will be invoked as well.
+ * <p>
+ * Use several attempts to reproduce the race condition.
+ * <p>
+ * Expected result: transaction is finished on both backup nodes and the
partition
+ * map exchange is completed as well.
+ */
+ @Test
+ public void testRecoveryNotDeadLockOnPrimaryFail() throws Exception {
+ backups = 2;
+ persistence = false;
+
+ for (int iter = 0; iter < 100; iter++) {
Review Comment:
Looks like number of repetitions can not be reduced.
So I have optimized the single repetion. It required to put test into the
separate class to have more optimized cache & node configuration.
The main idea of optimization is to restart the only node on each cycle
iteration.
On my laptop test execution time reduced from about 90 to 55 seconds for 100
iterations.
--
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]