dcapwell commented on code in PR #3689: URL: https://github.com/apache/cassandra/pull/3689#discussion_r1848850858
##########
test/distributed/org/apache/cassandra/fuzz/topology/HarryTopologyMixupTest.java:
##########
@@ -164,90 +216,49 @@ private static CommandGen<Spec> cqlOperations(Spec spec)
private static Command<State<Spec>, Void, ?> validateAll(State<Spec> state)
{
- Spec spec = state.schemaSpec;
- var schema = spec.harry.schema();
- boolean writeThroughAccord = schema.isWriteTimeFromAccord();
+ Spec spec = state.testState;
List<Command<State<Spec>, Void, ?>> reads = new ArrayList<>();
- Model model = spec.harry.quiescentChecker();
- for (Long pd : new TreeSet<>(spec.harry.pds()))
+
+ for (Integer pkIdx : spec.pkGen.generated())
{
- reads.add(new HarryCommand(s -> "Harry Validate pd=" + pd +
state.commandNamePostfix(), s -> model.validate(Query.selectAllColumns(schema,
pd, false))));
- // as of this writing Accord does not support ORDER BY
- if (!writeThroughAccord)
- reads.add(new HarryCommand(s -> "Harry Reverse Validate pd=" +
pd + state.commandNamePostfix(), s ->
model.validate(Query.selectAllColumns(schema, pd, true))));
+ long pd = spec.schema.valueGenerators.pkGen.descriptorAt(pkIdx);
+ reads.add(new HarryCommand(s -> String.format("Harry Validate
pd=%d%s", pd, state.commandNamePostfix()), s ->
spec.history.selectPartition(pkIdx)));
}
reads.add(new HarryCommand(s -> "Reset Harry Write State" +
state.commandNamePostfix(), s -> ((HarryState) s).numInserts = 0));
return Property.multistep(reads);
}
- private static class AccordSut extends InJvmSut
Review Comment:
this is hidden in `CQLVisitExecutor` which is used in
`CQLTesterVisitExecutor` and `InJvmDTestVisitExecutor`.
In the context of this test the caller is
```
new ReplayingHistoryBuilder(schema.valueGenerators,
hb ->
InJvmDTestVisitExecutor.builder()
.nodeSelector(new InJvmDTestVisitExecutor.NodeSelector()
{
private final AtomicLong cnt = new AtomicLong();
@Override
public int select(long lts)
{
for (int i = 0; i < 42; i++)
{
int selected = (int) (cnt.getAndIncrement() %
cluster.size() + 1);
if (!cluster.get(selected).isShutdown())
return selected;
}
throw new IllegalStateException("Unable to find an alive
instance");
}
})
.retryPolicy(t -> {
t = Throwables.getRootCause(t);
if (!TIMEOUT_CHECKER.matches(t))
return false;
TxnId id;
try
{
id = TxnId.parse(t.getMessage());
}
catch (Throwable t2)
{
return true;
}
try
{
int[] nodes = cluster.stream().filter(i ->
!i.isShutdown()).mapToInt(i -> i.config().num()).toArray();
logger.warn("Timeout for txn {}; debug info\n{}", id,
ClusterUtils.queryTxnStateAsString(cluster, id, nodes));
}
catch (Throwable t3)
{
t.addSuppressed(t3);
}
return false;
})
.build(schema, hb, cluster));
```
This is a regression of behavior and a pattern I worry about...
I ran in a debugger to confirm this and see
`org.apache.cassandra.fuzz.sai.AccordSingleNodeSAITest` is now broken by this
behavior... the test is explicitly testing pass through but now is avoiding the
passthrough case
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

