Skip to content
Permalink
Browse files
Merge branch 'cassandra-3.11' into cassandra-4.0
  • Loading branch information
Jon Meredith committed Jun 6, 2022
2 parents 52f6ac4 + c9a7269 commit 943184b1948c57fcfecdcd968bab02e2fca2ea56
Showing 1 changed file with 19 additions and 0 deletions.
@@ -24,14 +24,18 @@
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;

import org.junit.Assert;
import org.junit.Test;

import org.apache.cassandra.concurrent.Stage;
import org.apache.cassandra.distributed.api.ConsistencyLevel;
import org.apache.cassandra.distributed.Cluster;
import org.apache.cassandra.distributed.impl.IsolatedExecutor;
@@ -68,6 +72,21 @@ public void mutationsForwardedToAllReplicasTest()
//noinspection ResultOfMethodCallIgnored
inserts.map(IsolatedExecutor::waitOn).collect(Collectors.toList());

// Tracing is async with respect to queries, just because the query has completed it does not mean
// all tracing updates have completed. The tracing executor serializes work, so run a task through
// and everthing submitted before must have completed.
cluster.forEach(instance -> instance.runOnInstance(() -> {
Future<?> result = Stage.TRACING.submit(() -> null);
try
{
result.get(30, TimeUnit.SECONDS);
}
catch (ExecutionException | InterruptedException | TimeoutException ex)
{
throw new RuntimeException(ex);
}
}));

cluster.stream("dc1").forEach(instance -> forwardFromCounts.put(instance.broadcastAddress().getAddress(), 0));
cluster.forEach(instance -> commitCounts.put(instance.broadcastAddress().getAddress(), 0));
List<TracingUtil.TraceEntry> traces = TracingUtil.getTrace(cluster, sessionId, ConsistencyLevel.ALL);

0 comments on commit 943184b

Please sign in to comment.