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

Dmitry Konstantinov commented on CASSANDRA-21798:
-------------------------------------------------

Options to fix:
 #  Count shards in the newest epoch only 

{code:java}
Assertions.assertThat(topology.current().size()).isEqualTo(2); {code}

 #  Wait until the newest epoch is ready across a quorum, like: 

{code:java}
TopologyManager topologyManager = AccordService.instance().topology();
// a TCM snapshot can add an epoch without a topology change
AtomicReference<Topologies> topology = new AtomicReference<>();
Util.spinUntilTrue(() -> {
    long epoch = topologyManager.epoch();
    topology.set(topologyManager.active().withUnsyncedEpochs(routables, epoch, 
epoch, SelectShards.ALL));
    if (topology.get().size() == 1)
        return true;
    
WatermarkCollector.fetchAndReportWatermarksAsync(topologyManager).syncUninterruptibly();
    return false;
}, 30);
// we don't detect out-of-bounds read/write yet, so use this to validate we 
reach different shards
Assertions.assertThat(topology.get().totalShards()).isEqualTo(2);{code}

> Test failure: 
> distributed.test.accord.MixedReadAccordCQLTest::testMultipleShards
> --------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-21798
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-21798
>             Project: Apache Cassandra
>          Issue Type: Bug
>          Components: Accord, Test/dtest/java
>            Reporter: Dmitry Konstantinov
>            Assignee: Dmitry Konstantinov
>            Priority: Normal
>             Fix For: 6.x, 7.x
>
>
> We have a test failure on CI: 
> org.apache.cassandra.distributed.test.accord.MixedReadAccordCQLTest::testMultipleShards,
>  it reproduces consistently.
> {code:java}
> junit.framework.AssertionFailedError: expected:<[2]> but was:<[4]>
>       at 
> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>  Method)
>       at 
> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
>       at 
> java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>       at 
> java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
>       at 
> org.apache.cassandra.distributed.test.accord.AccordCQLTestBase.lambda$testMultipleShards$6d852ed$1(AccordCQLTestBase.java:968)
>       at 
> org.apache.cassandra.concurrent.FutureTask$2.call(FutureTask.java:124)
>       at org.apache.cassandra.concurrent.FutureTask.call(FutureTask.java:61)
>       at org.apache.cassandra.concurrent.FutureTask.run(FutureTask.java:71)
>       at 
> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
>       at 
> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
>       at 
> io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
>       at java.base/java.lang.Thread.run(Thread.java:840)
>       at 
> org.apache.cassandra.concurrent.CassandraThread.run(CassandraThread.java:169) 
> {code}
> Example: 
> https://astro-cass.ci/job/cassandra/43/testReport/junit/org.apache.cassandra.distributed.test.accord/MixedReadAccordCQLTest/Tests___jvm_dtest_jdk17_11_16___testMultipleShards__jdk17_x86_64/



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

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

Reply via email to