[ 
https://issues.apache.org/jira/browse/IGNITE-25492?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17954225#comment-17954225
 ] 

Kirill Tkalenko commented on IGNITE-25492:
------------------------------------------

The problem turned out to be that the 
*org.apache.ignite.internal.table.distributed.disaster.DisasterRecoveryManager* 
has 2 groups of methods, for zones when the collocation is available and for 
tables otherwise.

For me it was not immediately obvious, so I added a check to the methods for 
zones with a clearer message.

> Fix NPE for DisasterRecoveryManager#localPartitionStates with collocation 
> disabled
> ----------------------------------------------------------------------------------
>
>                 Key: IGNITE-25492
>                 URL: https://issues.apache.org/jira/browse/IGNITE-25492
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Kirill Tkalenko
>            Assignee: Kirill Tkalenko
>            Priority: Major
>              Labels: ignite-3
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> It was noticed that if you use 
> *org.apache.ignite.internal.table.distributed.disaster.DisasterRecoveryManager#localPartitionStates*
>  without collocation, then NPE appears, this needs to be fixed.
> To reproduce, it is enough to remove the annotation *@WithSystemProperty(key 
> = COLOCATION_FEATURE_FLAG, value = "true")* for test 
> *org.apache.ignite.internal.disaster.ItDisasterRecoveryManagerTest#testLocalPartitionStateZone*.
> {noformat}
> java.lang.AssertionError: java.util.concurrent.ExecutionException: 
> org.apache.ignite.internal.table.distributed.disaster.exceptions.DisasterRecoveryException:
>  IGN-RECOVERY-3 java.lang.NullPointerException TraceId:6afa9382
>       at 
> org.apache.ignite.internal.testframework.matchers.CompletableFutureMatcher.matchesSafely(CompletableFutureMatcher.java:78)
>       at 
> org.apache.ignite.internal.testframework.matchers.CompletableFutureMatcher.matchesSafely(CompletableFutureMatcher.java:35)
>       at org.hamcrest.TypeSafeMatcher.matches(TypeSafeMatcher.java:83)
>       at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:10)
>       at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:6)
>       at 
> org.apache.ignite.internal.disaster.ItDisasterRecoveryManagerTest.testLocalPartitionStateZone(ItDisasterRecoveryManagerTest.java:213)
>       at java.base/java.lang.reflect.Method.invoke(Method.java:566)
>       at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
>       at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
> Caused by: java.util.concurrent.ExecutionException: 
> org.apache.ignite.internal.table.distributed.disaster.exceptions.DisasterRecoveryException:
>  IGN-RECOVERY-3 java.lang.NullPointerException TraceId:6afa9382
>       at 
> java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
>       at 
> java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2028)
>       at 
> org.apache.ignite.internal.testframework.matchers.CompletableFutureMatcher.matchesSafely(CompletableFutureMatcher.java:74)
>       ... 8 more
> Caused by: 
> org.apache.ignite.internal.table.distributed.disaster.exceptions.DisasterRecoveryException:
>  IGN-RECOVERY-3 java.lang.NullPointerException TraceId:6afa9382
>       at 
> org.apache.ignite.internal.table.distributed.disaster.DisasterRecoveryManager.lambda$localPartitionStatesInternal$11(DisasterRecoveryManager.java:700)
>       at 
> java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:930)
>       at 
> java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:907)
>       at 
> java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
>       at 
> java.base/java.util.concurrent.CompletableFuture.postFire(CompletableFuture.java:610)
>       at 
> java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:910)
>       at 
> java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:478)
>       at 
> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
>       at 
> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
>       at java.base/java.lang.Thread.run(Thread.java:829)
> Caused by: java.util.concurrent.CompletionException: 
> java.lang.NullPointerException
>       at 
> java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314)
>       at 
> java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:319)
>       at 
> java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire$$$capture(CompletableFuture.java:718)
>       at 
> java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java)
>       at 
> java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
>       at 
> java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2079)
>       at 
> org.apache.ignite.internal.network.DefaultMessagingService.onInvokeResponse(DefaultMessagingService.java:606)
>       at 
> org.apache.ignite.internal.network.DefaultMessagingService.send0(DefaultMessagingService.java:277)
>       at 
> org.apache.ignite.internal.network.DefaultMessagingService.respond(DefaultMessagingService.java:220)
>       at 
> org.apache.ignite.internal.network.wrapper.JumpToExecutorByConsistentIdAfterSend.respond(JumpToExecutorByConsistentIdAfterSend.java:75)
>       at 
> org.apache.ignite.internal.network.MessagingService.respond(MessagingService.java:115)
>       at 
> org.apache.ignite.internal.table.distributed.disaster.DisasterRecoveryManager.lambda$handleLocalPartitionStatesRequest$27(DisasterRecoveryManager.java:1083)
>       at 
> java.base/java.util.concurrent.CompletableFuture$UniRun.tryFire$$$capture(CompletableFuture.java:783)
>       at 
> java.base/java.util.concurrent.CompletableFuture$UniRun.tryFire(CompletableFuture.java)
>       ... 4 more
> Caused by: java.lang.NullPointerException
>       at 
> org.apache.ignite.internal.table.distributed.disaster.DisasterRecoveryManager.lambda$zoneState$8(DisasterRecoveryManager.java:644)
>       at 
> org.apache.ignite.internal.table.distributed.disaster.DisasterRecoveryManager.lambda$localPartitionStatesInternal$10(DisasterRecoveryManager.java:685)
>       at 
> java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire$$$capture(CompletableFuture.java:714)
>       ... 15 more
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to