alanwang67 commented on code in PR #4692:
URL: https://github.com/apache/cassandra/pull/4692#discussion_r3096145349


##########
src/java/org/apache/cassandra/db/compaction/CompactionManager.java:
##########
@@ -1391,8 +1431,27 @@ public void forceUserDefinedCleanup(String dataFiles)
             ColumnFamilyStore cfs = entry.getKey();
             Keyspace keyspace = cfs.keyspace;
             final RangesAtEndpoint replicas = 
StorageService.instance.getLocalReplicas(keyspace.getName());
-            final Set<Range<Token>> allRanges = replicas.ranges();
-            final Set<Range<Token>> transientRanges = 
replicas.onlyTransient().ranges();
+
+            Set<Range<Token>> noLongerOwnedRangesInUseByAccord = new 
HashSet<>();
+            if (AccordService.isSetup())
+            {
+                if (!replicas.onlyTransient().ranges().isEmpty())
+                {
+                    logger.error("Transient replication is not supported for 
Accord");
+                    return;
+                }
+
+                if 
(AccordService.instance().getInUseRanges().containsKey(cfs.getTableId()))
+                {
+                    Set<Range<Token>> accordOwnedRanges = 
AccordService.instance().getInUseRanges().get(cfs.getTableId());
+                    for (Range<Token> range : accordOwnedRanges)
+                        
noLongerOwnedRangesInUseByAccord.addAll(range.subtractAll(replicas.ranges()));
+                }
+            }
+
+            final Set<Range<Token>> allRanges = 
Stream.concat(replicas.ranges().stream(), 
noLongerOwnedRangesInUseByAccord.stream()).collect(Collectors.toSet());
+            final Set<Range<Token>> transientRanges = new 
HashSet<>(replicas.onlyTransient().ranges());

Review Comment:
   Just changed it back. 



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