This is an automated email from the ASF dual-hosted git repository.

aleksey pushed a commit to branch cep-45-mutation-tracking
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/cep-45-mutation-tracking by 
this push:
     new 942fa5a3f3 Fix CoordinatorLogOffsetsLifecycleTest
942fa5a3f3 is described below

commit 942fa5a3f3a7deb031a77813e35ea150bd3781cf
Author: Aleksey Yeschenko <[email protected]>
AuthorDate: Thu Sep 25 14:34:44 2025 +0100

    Fix CoordinatorLogOffsetsLifecycleTest
---
 .../replication/MutationTrackingService.java        |  6 ++++++
 .../db/CoordinatorLogOffsetsLifecycleTest.java      | 21 +++++++++++++--------
 2 files changed, 19 insertions(+), 8 deletions(-)

diff --git 
a/src/java/org/apache/cassandra/replication/MutationTrackingService.java 
b/src/java/org/apache/cassandra/replication/MutationTrackingService.java
index f780a35bfa..6dc1bcc963 100644
--- a/src/java/org/apache/cassandra/replication/MutationTrackingService.java
+++ b/src/java/org/apache/cassandra/replication/MutationTrackingService.java
@@ -555,6 +555,12 @@ public class MutationTrackingService
         }
     }
 
+    @VisibleForTesting
+    public void persistLogStateForTesting()
+    {
+        offsetsPersister.run();
+    }
+
     @VisibleForTesting
     public void broadcastOffsetsForTesting()
     {
diff --git 
a/test/unit/org/apache/cassandra/db/CoordinatorLogOffsetsLifecycleTest.java 
b/test/unit/org/apache/cassandra/db/CoordinatorLogOffsetsLifecycleTest.java
index 98472ad1e3..20d098fcb1 100644
--- a/test/unit/org/apache/cassandra/db/CoordinatorLogOffsetsLifecycleTest.java
+++ b/test/unit/org/apache/cassandra/db/CoordinatorLogOffsetsLifecycleTest.java
@@ -141,14 +141,17 @@ public class CoordinatorLogOffsetsLifecycleTest
     {
         String ks = nextKeyspaceName();
         String tbl = "tbl";
-        TableMetadata tableMetadata = TableMetadata.builder(ks, tbl)
-                                                   .addPartitionKeyColumn("k", 
Int32Type.instance)
-                                                   .addRegularColumn("v", 
Int32Type.instance)
-                                                   .build();
-
-        TableParams tableParams = tableMetadata.params;
-        tableParams = 
tableParams.unbuild().memtable(MemtableParams.get(memtableConfig)).build();
-        tableMetadata = tableMetadata.withSwapped(tableParams);
+        TableParams tableParams =
+            TableParams.builder()
+                       .memtable(MemtableParams.get(memtableConfig))
+                       .build();
+
+        TableMetadata tableMetadata =
+            TableMetadata.builder(ks, tbl)
+                         .addPartitionKeyColumn("k", Int32Type.instance)
+                         .addRegularColumn("v", Int32Type.instance)
+                         .params(tableParams)
+                         .build();
 
         SchemaLoader.createKeyspace(ks, KeyspaceParams.simple(1, 
ReplicationType.tracked), tableMetadata);
 
@@ -183,6 +186,7 @@ public class CoordinatorLogOffsetsLifecycleTest
 
         // flush 1
         {
+            MutationTrackingService.instance.persistLogStateForTesting();
             cfs.forceBlockingFlush(ColumnFamilyStore.FlushReason.UNIT_TESTS);
 
             View view = cfs.getTracker().getView();
@@ -216,6 +220,7 @@ public class CoordinatorLogOffsetsLifecycleTest
 
         // flush 2
         {
+            MutationTrackingService.instance.persistLogStateForTesting();
             cfs.forceBlockingFlush(ColumnFamilyStore.FlushReason.UNIT_TESTS);
 
             View view = cfs.getTracker().getView();


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to