JKonSir commented on code in PR #7680:
URL: https://github.com/apache/ignite-3/pull/7680#discussion_r3044326947
##########
modules/transactions/src/integrationTest/java/org/apache/ignite/tx/distributed/ItTxCleanupFailureTest.java:
##########
@@ -52,6 +98,50 @@ public void setup() {
sql(tableSql);
}
+ /**
+ * Verifies that no retry occurs when the write intent cleanup succeeds on
the first attempt.
+ *
+ * <p>Installs a message interceptor that counts {@link
WriteIntentSwitchReplicaRequest}
+ * messages without dropping any of them. After all write intents are
resolved, asserts
+ * that exactly one cleanup message was sent across all nodes.
+ */
+ @Test
+ public void testNoRetryOnSuccessfulCleanup() {
+ IgniteImpl node = anyNode();
+ Transaction tx = node.transactions().begin();
+ node.sql().execute(tx, "insert into " + TABLE_NAME + " (key, val)
values (1, 'val-1')");
+
+ AtomicInteger cleanupAttempts = new AtomicInteger();
+
+ for (IgniteImpl n : runningNodesIter()) {
+ n.dropMessages((dest, msg) -> {
+ if (msg instanceof WriteIntentSwitchReplicaRequest) {
+ cleanupAttempts.incrementAndGet();
+ }
+ return false;
+ });
+ }
+
+ tx.commitAsync();
+
+ await().timeout(5, TimeUnit.SECONDS)
Review Comment:
done
--
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]