maedhroz commented on code in PR #4696:
URL: https://github.com/apache/cassandra/pull/4696#discussion_r3024513448


##########
src/java/org/apache/cassandra/io/sstable/format/SSTableWriter.java:
##########
@@ -337,16 +339,32 @@ public final void abort()
 
     protected Map<MetadataType, MetadataComponent> finalizeMetadata()
     {
-        // Reconciliation should not occur before activation for coordinated 
transfer streams for tracked keyspaces. 
+        // Reconciliation should not occur before activation for coordinated 
transfer streams for tracked keyspaces.
         boolean reconcile = txn.opType() != OperationType.STREAM;
 
+        // During migration, incremental repair handles repair status for 
ranges still pending migration.
+        // Only apply mutation tracking reconciliation for ranges NOT in the 
migration pending set.
+        // For SSTables whose range falls within pending migration ranges, IR 
sets pendingRepair/repairedAt.
         if (metadata().replicationType().isTracked() && repairedAt == 
ActiveRepairService.UNREPAIRED_SSTABLE && reconcile)
         {
-            Preconditions.checkState(Objects.equals(pendingRepair, 
ActiveRepairService.NO_PENDING_REPAIR));
-            if 
(MutationTrackingService.instance().isDurablyReconciled(coordinatorLogOffsets))
+            boolean inMigrationPendingRange = false;
+            KeyspaceMigrationInfo migrationInfo = 
ClusterMetadata.current().mutationTrackingMigrationState
+                                                                 
.getKeyspaceInfo(metadata().keyspace);
+            if (migrationInfo != null)
             {
-                repairedAt = Clock.Global.currentTimeMillis();
-                logger.debug("Marking SSTable {} as reconciled with repairedAt 
{}", descriptor, repairedAt);
+                inMigrationPendingRange = 
migrationInfo.isRangeInPendingMigration(metadata().id,
+                                                                               
    first.getToken(),
+                                                                               
    last.getToken());
+            }

Review Comment:
   nit: Could replace the above w/
   
   ```
   KeyspaceMigrationInfo migrationInfo = 
ClusterMetadata.current().mutationTrackingMigrationState.getKeyspaceInfo(metadata().keyspace);
   boolean inMigrationPendingRange = migrationInfo != null && 
migrationInfo.isRangeInPendingMigration(metadata().id, first.getToken(), 
last.getToken());
   ```



-- 
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