Skip to content

Commit dfb6768

Browse files
authored
CNDB-13118 Fix CoordinatorReadLatencyMetricTest changing internalPagingWIthAggregateTest to use paging in bytes for CC. (#1702)
### What is the issue With the rebase of CC on C* 5.0.2, there is a new test CoordinatorReadLatencyMetricTest and CoordinatorReadLatencyMetricTest.internalPagingWithAggregateTest is failing. ### What does this PR fix and why was it fixed Uses paging in bytes instead of paging in rows in internalPagingWithAggregateTest.
1 parent 7258443 commit dfb6768

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

test/distributed/org/apache/cassandra/distributed/test/metrics/CoordinatorReadLatencyMetricTest.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@
2222
import java.util.stream.Collectors;
2323
import java.util.stream.IntStream;
2424

25+
import org.apache.commons.lang3.StringUtils;
2526
import org.junit.Test;
2627

2728
import org.apache.cassandra.config.Config;
29+
import org.apache.cassandra.config.DatabaseDescriptor;
2830
import org.apache.cassandra.distributed.Cluster;
2931
import org.apache.cassandra.distributed.api.ConsistencyLevel;
3032
import org.apache.cassandra.distributed.test.TestBaseImpl;
@@ -41,9 +43,14 @@ public void internalPagingWithAggregateTest() throws Throwable
4143
{
4244
try (Cluster cluster = init(builder().withNodes(1).start()))
4345
{
44-
cluster.schemaChange(withKeyspace("CREATE TABLE %s.tbl (pk int, ck int, v int, PRIMARY KEY (pk, ck))"));
46+
// CC only supports paging in bytes. Set the smallest page size allowed.
47+
cluster.get(1).callOnInstance(() -> DatabaseDescriptor.getRawConfig().aggregation_subpage_size_in_kb = 1);
48+
49+
// Create rows greater than the 1kb subpage size
50+
String payload = StringUtils.repeat('1', 1024 * 2);
51+
cluster.schemaChange(withKeyspace("CREATE TABLE %s.tbl (pk int, ck int, v text, PRIMARY KEY (pk, ck))"));
4552
for (int i = 0; i < 100; i++)
46-
cluster.coordinator(1).execute(withKeyspace("insert into %s.tbl (pk, ck ,v) values (0, ?, 1)"), ConsistencyLevel.ALL, i);
53+
cluster.coordinator(1).execute(withKeyspace("insert into %s.tbl (pk, ck ,v) values (0, ?, ?)"), ConsistencyLevel.ALL, i, payload);
4754

4855
// Serial and non-serial reads have separates code paths, so exercise them both
4956
testAggregationQuery(cluster, ConsistencyLevel.ALL);

0 commit comments

Comments
 (0)