luoyuxia commented on code in PR #3174:
URL: https://github.com/apache/fluss/pull/3174#discussion_r3338449767


##########
fluss-server/src/main/java/org/apache/fluss/server/coordinator/CoordinatorEventProcessor.java:
##########
@@ -886,6 +905,11 @@ private void processDropTable(DropTableEvent 
dropTableEvent) {
 
         // remove table metrics.
         
coordinatorMetricGroup.removeTableMetricGroup(dropTableInfo.getTablePath(), 
tableId);
+
+        // For partitioned tables the table-level assignment is empty, so no
+        // DeleteReplicaResponse will ever arrive to trigger resumeDeletions().
+        // Call it now so the vacuously-complete table is finalized 
immediately.
+        tableManager.resumeDeletions();

Review Comment:
   Partition replica deletions will still produce DeleteReplicaResponse events 
via DropPartitionEvent -> onDeletePartition(); which will then trigger 
resumeDeletions.
   
   So, do we really need to call `tableManager.resumeDeletions();` in here? 



##########
fluss-server/src/main/java/org/apache/fluss/server/coordinator/TableManager.java:
##########
@@ -321,16 +348,12 @@ private void asyncDeletePartitionMetadata(long 
partitionId) {
     }
 
     private boolean isEligibleForDeletion(long tableId) {
-        // the table is queued for deletion and

Review Comment:
   why remove the comments?



##########
fluss-server/src/main/java/org/apache/fluss/server/coordinator/TableManager.java:
##########
@@ -321,16 +348,12 @@ private void asyncDeletePartitionMetadata(long 
partitionId) {
     }
 
     private boolean isEligibleForDeletion(long tableId) {
-        // the table is queued for deletion and
-        // no any replica is in state deletion started
         return coordinatorContext.isTableQueuedForDeletion(tableId)
                 && !coordinatorContext.isAnyReplicaInState(
                         tableId, ReplicaState.ReplicaDeletionStarted);
     }
 
     private boolean isEligibleForDeletion(TablePartition tablePartition) {
-        // the partition is queued for deletion and

Review Comment:
   why remove the comments?



##########
fluss-server/src/main/java/org/apache/fluss/server/coordinator/TableManager.java:
##########
@@ -208,45 +224,49 @@ public void resumeDeletions() {
 
     private void resumeTableDeletions() {
         Set<Long> tablesToBeDeleted = new 
HashSet<>(coordinatorContext.getTablesToBeDeleted());
-        Set<Long> eligibleTableDeletion = new HashSet<>();
-
         for (long tableId : tablesToBeDeleted) {
-            // if all replicas are marked as deleted successfully, then table 
deletion is done
             if (coordinatorContext.areAllReplicasInState(
                     tableId, ReplicaState.ReplicaDeletionSuccessful)) {
                 completeDeleteTable(tableId);
                 LOG.info("Deletion of table with id {} successfully 
completed.", tableId);
-            }
-            if (isEligibleForDeletion(tableId)) {
-                eligibleTableDeletion.add(tableId);
-            }
-        }
-        if (!eligibleTableDeletion.isEmpty()) {
-            for (long tableId : eligibleTableDeletion) {
-                onDeleteTable(tableId);
+            } else if (isEligibleForDeletion(tableId)) {
+                if (replicaCleanupManager != null) {
+                    int bucketCount = 
coordinatorContext.getAllBucketsForTable(tableId).size();
+                    replicaCleanupManager.submitTableDropForResume(
+                            tableId, bucketCount, () -> 
onDeleteTable(tableId));
+                } else {
+                    onDeleteTable(tableId);
+                }
             }
         }
     }
 
     private void resumePartitionDeletions() {
         Set<TablePartition> partitionsToDelete =
                 new HashSet<>(coordinatorContext.getPartitionsToBeDeleted());
-        Set<TablePartition> eligiblePartitionDeletion = new HashSet<>();
-
         for (TablePartition partition : partitionsToDelete) {
-            // if all replicas are marked as deleted successfully, then 
partition deletion is done

Review Comment:
   nit: why remove the comments



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

Reply via email to