Skip to content
Permalink
Browse files
Merge branch 'cassandra-3.0' into cassandra-3.11
  • Loading branch information
Jon Meredith committed Jun 6, 2022
2 parents 8a9ba88 + ba0555e commit c9a7269874032381dfebeee61073e1a37378f49c
Showing 1 changed file with 20 additions and 0 deletions.
@@ -24,13 +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.IntStream;
import java.util.stream.Stream;

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

import org.apache.cassandra.concurrent.Stage;
import org.apache.cassandra.concurrent.StageManager;
import org.apache.cassandra.distributed.Cluster;
import org.apache.cassandra.distributed.api.ConsistencyLevel;
import org.apache.cassandra.distributed.impl.IsolatedExecutor;
@@ -66,6 +71,21 @@ public void mutationsForwardedToAllReplicasTest()
//noinspection ResultOfMethodCallIgnored
inserts.map(IsolatedExecutor::waitOn).count();

// 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 = StageManager.getStage(Stage.TRACING).submit(() -> null);
try
{
result.get(30, TimeUnit.SECONDS);
}
catch (ExecutionException | InterruptedException | TimeoutException ex)
{
throw new RuntimeException(ex);
}
}));

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

0 comments on commit c9a7269

Please sign in to comment.