aratno commented on code in PR #4192:
URL: https://github.com/apache/cassandra/pull/4192#discussion_r2167540548


##########
src/java/org/apache/cassandra/replication/MutationTrackingService.java:
##########
@@ -180,12 +180,41 @@ int nextHostLogId()
     }
     private final AtomicInteger nextHostLogId = new AtomicInteger();
 
-    private static class KeyspaceShards
+    public boolean isDurablyReconciled(String keyspace, 
CoordinatorLogOffsets<Offsets.Immutable> logOffsets)
+    {
+        // Could pass through SSTable bounds to exclude shards for 
non-overlapping ranges, but this will mostly be
+        // called on flush for L0 SSTables with wide bounds.
+
+        KeyspaceShards keyspaceShards = shards.get(keyspace);
+        if (keyspaceShards == null)
+        {
+            logger.debug("Could not find shards for keyspace {}", keyspace);
+            return false;
+        }
+
+        for (Long logId : logOffsets)
+        {
+            CoordinatorLogId coordinatorLogId = new CoordinatorLogId(logId);
+            CoordinatorLog log = keyspaceShards.logs.get(coordinatorLogId);
+            if (log == null)
+            {
+                logger.debug("Could not find log {}", coordinatorLogId);

Review Comment:
   I've revised my thinking regarding backup and restore - this should go over 
the same import path we'll need to support for cassandra-analytics, which 
should work the same way regardless of whether the imported SSTable already has 
some CoordinatorLogOffsets attached. If offsets are already attached we can't 
use them, that's all.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to