dcapwell commented on code in PR #3574:
URL: https://github.com/apache/cassandra/pull/3574#discussion_r1776068058


##########
src/java/org/apache/cassandra/service/accord/AccordService.java:
##########
@@ -1073,4 +1087,217 @@ public CompactionInfo getCompactionInfo()
         }));
         return new CompactionInfo(redundantBefores, ranges, 
durableBefore.get());
     }
+
+    @Override
+    public void awaitForTableDrop(TableId id)
+    {
+        // Need to make sure no existing txn are still being processed for 
this table... this is only used by DROP TABLE so NEW txn are expected to be 
blocked, so just need to "wait" for existing ones to complete
+        Topology topology = node.topology().current();
+        List<TokenRange> ranges = topology.reduce(new ArrayList<>(),
+                                                  s -> ((TokenRange) 
s.range).table().equals(id),
+                                                  (accum, s) -> {
+                                                      accum.add((TokenRange) 
s.range);
+                                                      return accum;
+                                                  });
+        if (ranges.isEmpty()) return; // nothing to see here
+
+        ColumnFamilyStore cfs = 
Schema.instance.getColumnFamilyStoreInstance(id);
+        Invariants.checkState(cfs != null, "Unable to find table %s", id);
+        BigInteger targetSplitSize = BigInteger.valueOf(Math.max(1, 
cfs.estimateKeys() / 1_000_000));
+
+        List<AsyncChain<?>> syncs = new ArrayList<>(ranges.size());

Review Comment:
   I could add visibility into what's going on, but there is an assumption that 
Benedict is making a cheaper option, so holding off doing that work hoping that 
option can replace this splitting.



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