[ 
https://issues.apache.org/jira/browse/IGNITE-22027?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alexander Lapin updated IGNITE-22027:
-------------------------------------
    Description: 
 
{code:java}
org.opentest4j.AssertionFailedError: expected: <false> but was: <true>  at 
app//org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
  at 
app//org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
  at app//org.junit.jupiter.api.AssertFalse.failNotFalse(AssertFalse.java:63)  
at app//org.junit.jupiter.api.AssertFalse.assertFalse(AssertFalse.java:36)  at 
app//org.junit.jupiter.api.AssertFalse.assertFalse(AssertFalse.java:31)  at 
app//org.junit.jupiter.api.Assertions.assertFalse(Assertions.java:231)  at 
app//org.apache.ignite.internal.placementdriver.ItPrimaryReplicaChoiceTest.testPrimaryChangeLongHandling(ItPrimaryReplicaChoiceTest.java:189)
 {code}
Long story short, it's because of minor bug in NodeUtils#transferPrimary.

While choosing new primary in case of null preferablePrimary following logic 
was used
{code:java}
if (preferablePrimary == null) {
    preferablePrimary = nodes.stream()
            .map(IgniteImpl::name)
            .filter(n -> n.equals(currentLeaseholder.getLeaseholder()))
            .findFirst()
            .orElseThrow();
} {code}
that always selects current primary as new one. Apparently "!" was missing in
{code:java}
.filter(n -> n.equals(currentLeaseholder.getLeaseholder())){code}
 

 

> ItPrimaryReplicaChoiceTest#testPrimaryChangeLongHandling is flaky
> -----------------------------------------------------------------
>
>                 Key: IGNITE-22027
>                 URL: https://issues.apache.org/jira/browse/IGNITE-22027
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Alexander Lapin
>            Priority: Major
>              Labels: ignite-3
>
>  
> {code:java}
> org.opentest4j.AssertionFailedError: expected: <false> but was: <true>  at 
> app//org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
>   at 
> app//org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
>   at app//org.junit.jupiter.api.AssertFalse.failNotFalse(AssertFalse.java:63) 
>  at app//org.junit.jupiter.api.AssertFalse.assertFalse(AssertFalse.java:36)  
> at app//org.junit.jupiter.api.AssertFalse.assertFalse(AssertFalse.java:31)  
> at app//org.junit.jupiter.api.Assertions.assertFalse(Assertions.java:231)  at 
> app//org.apache.ignite.internal.placementdriver.ItPrimaryReplicaChoiceTest.testPrimaryChangeLongHandling(ItPrimaryReplicaChoiceTest.java:189)
>  {code}
> Long story short, it's because of minor bug in NodeUtils#transferPrimary.
> While choosing new primary in case of null preferablePrimary following logic 
> was used
> {code:java}
> if (preferablePrimary == null) {
>     preferablePrimary = nodes.stream()
>             .map(IgniteImpl::name)
>             .filter(n -> n.equals(currentLeaseholder.getLeaseholder()))
>             .findFirst()
>             .orElseThrow();
> } {code}
> that always selects current primary as new one. Apparently "!" was missing in
> {code:java}
> .filter(n -> n.equals(currentLeaseholder.getLeaseholder())){code}
>  
>  



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

Reply via email to