You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "frankgh (via GitHub)" <gi...@apache.org> on 2026/05/12 00:25:09 UTC

Re: [PR] Background reconciliation - replica [cassandra]

frankgh commented on code in PR #4761:
URL: https://github.com/apache/cassandra/pull/4761#discussion_r3222942151


##########
src/java/org/apache/cassandra/replication/MutationTrackingService.java:
##########
@@ -1372,6 +1374,94 @@ static int loadHostLogIdFromSystemTable()
         return rows.one().getInt("host_log_id");
     }
 
+    private static class BackgroundReconciler
+    {
+        private static final long RECONCILE_INTERVAL_MILLIS = 1_000;
+
+        private volatile boolean isPaused = false;
+
+        void start()
+        {
+            executor.scheduleWithFixedDelay(this::run,
+                                            RECONCILE_INTERVAL_MILLIS,
+                                            RECONCILE_INTERVAL_MILLIS,
+                                            TimeUnit.MILLISECONDS);
+        }
+
+        void run()
+        {
+            MutationTrackingService.instance().forEachKeyspace(this::run);
+        }
+
+        private void run(KeyspaceShards shards)
+        {
+            if (!isPaused)
+                shards.forEachShard(this::run);
+        }
+
+        private void run(Shard shard)
+        {
+            try
+            {
+                List<Offsets.Immutable> missing = shard.collectLocallyMissingOffsets();

Review Comment:
   I'll go ahead and open a follow up JIRA 



-- 
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: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org