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

Yifan Cai edited comment on CASSANDRA-16229 at 1/19/21, 11:33 PM:
------------------------------------------------------------------

Thanks for the patch! Agree with your analysis. The manual endpoint removal 
does not seem to be necessary, and could cause race with handling the left 
status. 

A nit for the test case is to add an explicit check after removing node3 from 
the ring. It checks that from the perspective of the remaining nodes, there 
should be just 2 nodes. 
{code:java}
cluster.run(GossipHelper.removeFromRing(cluster.get(3)), 1, 2);
// assert that node1 and node2 only sees 2 nodes in the ring. 
cluster.run(inst -> inst.runsOnInstance(() -> {
    Assert.assertEquals("There should be 2 remaining nodes in ring", 
                        2, 
StorageService.instance.effectiveOwnershipWithPort(KEYSPACE).size());
}), 1, 2);
{code}


was (Author: yifanc):
Thanks for the patch! Agree with your analysis. The manual endpoint removal 
does not seem to be necessary, and could cause race with handling the left 
status. 

A nit for the test case is to add an explicit check after removing node3 from 
the right. It checks that from the perspective of the remaining nodes, there 
should be just 2 nodes. 
{code:java}
cluster.run(GossipHelper.removeFromRing(cluster.get(3)), 1, 2);
// assert that node1 and node2 only sees 2 nodes in the ring. 
cluster.run(inst -> inst.runsOnInstance(() -> {
    Assert.assertEquals("There should be 2 remaining nodes in ring", 
                        2, 
StorageService.instance.effectiveOwnershipWithPort(KEYSPACE).size());
}), 1, 2);
{code}

> Flaky jvm-dtest: 
> org.apache.cassandra.distributed.test.ring.NodeNotInRingTest.nodeNotInRingTest
> -----------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-16229
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-16229
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Test/dtest/java
>            Reporter: Yifan Cai
>            Assignee: Brandon Williams
>            Priority: Normal
>             Fix For: 4.0-beta
>
>
> Test failed during CI build. Stack trace attached below, 
> [https://app.circleci.com/pipelines/github/yifan-c/cassandra/135/workflows/371dee8e-36d2-41a1-b27f-f7578496a1fe/jobs/681]
> {code:java}
> Testcase: 
> nodeNotInRingTest(org.apache.cassandra.distributed.test.ring.NodeNotInRingTest):
>   FAILED
> expected:<86> but was:<100>
> junit.framework.AssertionFailedError: expected:<86> but was:<100>
>  at 
> org.apache.cassandra.distributed.test.ring.NodeNotInRingTest.nodeNotInRingTest(NodeNotInRingTest.java:60)
>  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native 
> Method)
>  at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>  at 
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43){code}
> Besides the flakiness, the expected and the actual values are swapped in the 
> assertion statement.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to