dcapwell commented on code in PR #3656:
URL: https://github.com/apache/cassandra/pull/3656#discussion_r1828447487
##########
test/distributed/org/apache/cassandra/fuzz/topology/TopologyMixupTestBase.java:
##########
@@ -153,8 +158,50 @@ private enum RemoveType
private Command<State<S>, Void, ?> waitForCMSToQuiesce()
{
- return new SimpleCommand<>(state -> "Waiting for CMS to Quiesce" +
state.commandNamePostfix(),
- state ->
ClusterUtils.waitForCMSToQuiesce(state.cluster, state.cmsGroup));
+ return new Property.StateOnlyCommand<>()
+ {
+ private Epoch maxEpoch = null;
+ @Override
+ public String detailed(State<S> state)
+ {
+ if (maxEpoch == null)
+ maxEpoch = ClusterUtils.maxEpoch(state.cluster,
state.topologyHistory.up());
+ return "Waiting for CMS to Quiesce on epoch " +
maxEpoch.getEpoch() + state.commandNamePostfix();
+ }
+
+ @Override
+ public void applyUnit(State<S> state)
+ {
+ Invariants.nonNull(maxEpoch, "detailed was not called before
calling apply");
+ ClusterUtils.waitForCMSToQuiesce(state.cluster, maxEpoch,
true);
+ }
+ };
+ }
+
+ private Command<State<S>, Void, ?> waitForGossipToSettle()
+ {
+ return new SimpleCommand<>(state -> "Waiting for Ring to Settle" +
state.commandNamePostfix(),
+ state -> {
+ int[] up = state.topologyHistory.up();
+ for (int node : up)
+ {
+ IInvokableInstance instance =
state.cluster.get(node);
+
ClusterUtils.awaitRingJoin(state.cluster, up, instance);
+ }
+ });
+ }
+
+ private Command<State<S>, Void, ?> waitAllNodesInPeers()
Review Comment:
this is to make sure that the ring model doesn't NPE... partial writes to
peers table with async publish is fun!
--
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]