This is an automated email from the ASF dual-hosted git repository.
rpuch pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
The following commit(s) were added to refs/heads/main by this push:
new 21becdb5ac5 IGNITE-27526 Fix
testWriteIntentResolutionAfterTableAlreadyDestroyed (#7377)
21becdb5ac5 is described below
commit 21becdb5ac513d3b12a07640a19ab705fe8ab098
Author: Phillippko <[email protected]>
AuthorDate: Wed Jan 14 22:43:48 2026 +0700
IGNITE-27526 Fix testWriteIntentResolutionAfterTableAlreadyDestroyed (#7377)
---
.../ItWriteIntentSwitchRequestHandlerTest.java | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)
diff --git
a/modules/partition-replicator/src/integrationTest/java/org/apache/ignite/internal/partition/replicator/ItWriteIntentSwitchRequestHandlerTest.java
b/modules/partition-replicator/src/integrationTest/java/org/apache/ignite/internal/partition/replicator/ItWriteIntentSwitchRequestHandlerTest.java
index 3d2b77bae4a..a8a7b0a1b3a 100644
---
a/modules/partition-replicator/src/integrationTest/java/org/apache/ignite/internal/partition/replicator/ItWriteIntentSwitchRequestHandlerTest.java
+++
b/modules/partition-replicator/src/integrationTest/java/org/apache/ignite/internal/partition/replicator/ItWriteIntentSwitchRequestHandlerTest.java
@@ -60,27 +60,23 @@ public class ItWriteIntentSwitchRequestHandlerTest extends
ClusterPerTestIntegra
executeSql("CREATE TABLE " + tableName + " (id INT PRIMARY KEY, val
INT)");
- // This node will send WriteIntentSwitchReplicaRequest messages.
- IgniteImpl senderNode = unwrapIgniteImpl(cluster.node(0));
-
- int receiverNodeIndex = 1;
- // This node will process WriteIntentSwitchReplicaRequest messages.
- IgniteImpl receiverNode =
unwrapIgniteImpl(cluster.node(receiverNodeIndex));
+ // This node will fail cleanups till table is dropped.
+ IgniteImpl delayedCleanupNode = unwrapIgniteImpl(cluster.node(0));
CompletableFuture<Void> tableDestroyedFut = new CompletableFuture<>();
- failIntentSwitchUntilTableIsDestroyed(senderNode, tableDestroyedFut);
+ failIntentSwitchUntilTableIsDestroyed(delayedCleanupNode,
tableDestroyedFut);
- receiverNode.transactions().runInTransaction((tx) -> {
+ delayedCleanupNode.transactions().runInTransaction((tx) -> {
for (int i = 0; i < 10; i++) {
- executeSql(receiverNodeIndex, tx, "INSERT INTO " + tableName +
" (id, val) VALUES (?, ?)", i, i);
+ executeSql(0, tx, "INSERT INTO " + tableName + " (id, val)
VALUES (?, ?)", i, i);
}
});
executeSql("DROP TABLE " + tableName);
// Await real table destruction.
- await().until(() ->
receiverNode.distributedTableManager().cachedTable(tableName) == null);
+ await().until(() ->
delayedCleanupNode.distributedTableManager().cachedTable(tableName) == null);
LogInspector logInspector = new LogInspector(
TxCleanupRequestHandler.class.getName(),
@@ -99,8 +95,8 @@ public class ItWriteIntentSwitchRequestHandlerTest extends
ClusterPerTestIntegra
}
}
- private static void failIntentSwitchUntilTableIsDestroyed(IgniteImpl
node0, CompletableFuture<Void> tableDroppedFut) {
- node0.dropMessages((recipientId, message) ->
+ private static void failIntentSwitchUntilTableIsDestroyed(IgniteImpl
senderNode, CompletableFuture<Void> tableDroppedFut) {
+ senderNode.dropMessages((recipientId, message) ->
message.getClass().getName().contains("WriteIntentSwitchReplicaRequest") &&
!tableDroppedFut.isDone());
}
}