This is an automated email from the ASF dual-hosted git repository.
sk0x50 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 bf32cbee079 IGNITE-28123 ClientPrimaryReplicaTracker: avoid
null-partitions failure when primary-replica lookup completes exceptionally
(#7741)
bf32cbee079 is described below
commit bf32cbee079e11282496407fa457bd5be7df0fdb
Author: Anton Laletin <[email protected]>
AuthorDate: Wed Mar 11 21:45:33 2026 +0400
IGNITE-28123 ClientPrimaryReplicaTracker: avoid null-partitions failure
when primary-replica lookup completes exceptionally (#7741)
---
.../client/handler/ClientPrimaryReplicaTracker.java | 3 ++-
.../handler/ClientPrimaryReplicaTrackerTest.java | 21 +++++++++++++++++++++
2 files changed, 23 insertions(+), 1 deletion(-)
diff --git
a/modules/client-handler/src/main/java/org/apache/ignite/client/handler/ClientPrimaryReplicaTracker.java
b/modules/client-handler/src/main/java/org/apache/ignite/client/handler/ClientPrimaryReplicaTracker.java
index 0d2ee7b1c75..07675daf065 100644
---
a/modules/client-handler/src/main/java/org/apache/ignite/client/handler/ClientPrimaryReplicaTracker.java
+++
b/modules/client-handler/src/main/java/org/apache/ignite/client/handler/ClientPrimaryReplicaTracker.java
@@ -20,6 +20,7 @@ package org.apache.ignite.client.handler;
import static java.util.concurrent.CompletableFuture.completedFuture;
import static
org.apache.ignite.client.handler.requests.table.ClientTableCommon.tableIdNotFoundException;
import static org.apache.ignite.internal.event.EventListener.fromConsumer;
+import static org.apache.ignite.internal.util.ExceptionUtils.sneakyThrow;
import static org.apache.ignite.internal.util.IgniteUtils.inBusyLock;
import static org.apache.ignite.internal.util.IgniteUtils.inBusyLockSafe;
@@ -197,7 +198,7 @@ public class ClientPrimaryReplicaTracker {
throw new CompletionException(cause);
}
- assert false : "Unexpected error: " + err;
+ throw sneakyThrow(err);
}
PrimaryReplicasResult res = primaryReplicasNoWait(tableId,
maxStartTime0, timestamp, true);
diff --git
a/modules/client-handler/src/test/java/org/apache/ignite/client/handler/ClientPrimaryReplicaTrackerTest.java
b/modules/client-handler/src/test/java/org/apache/ignite/client/handler/ClientPrimaryReplicaTrackerTest.java
index a9cc1ae994c..54957020627 100644
---
a/modules/client-handler/src/test/java/org/apache/ignite/client/handler/ClientPrimaryReplicaTrackerTest.java
+++
b/modules/client-handler/src/test/java/org/apache/ignite/client/handler/ClientPrimaryReplicaTrackerTest.java
@@ -20,11 +20,13 @@ package org.apache.ignite.client.handler;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import java.util.List;
import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.CompletionException;
import java.util.concurrent.atomic.AtomicLong;
import
org.apache.ignite.client.handler.ClientPrimaryReplicaTracker.PrimaryReplicasResult;
import org.apache.ignite.internal.TestHybridClock;
@@ -134,6 +136,25 @@ class ClientPrimaryReplicaTrackerTest extends
BaseIgniteAbstractTest {
assertEquals("s2", replicas.nodeNames().get(1));
}
+ @Test
+ public void testFailedPrimaryReplicaRequestPropagatesOriginalError() {
+ driver.returnError(true);
+ tracker.start();
+
+ try {
+ tracker.primaryReplicasAsync(TABLE_ID, null).join();
+ fail("Expected completion to fail");
+ } catch (CompletionException e) {
+ Throwable cause = e.getCause();
+ while (cause instanceof CompletionException && cause.getCause() !=
null) {
+ cause = cause.getCause();
+ }
+
+ assertTrue(cause instanceof RuntimeException);
+ assertEquals("FakePlacementDriver expected error",
cause.getMessage());
+ }
+ }
+
@Test
public void testOldEventsAreIgnoredByLeaseStartTime() {
tracker.start();