zhtaoxiang commented on code in PR #12343:
URL: https://github.com/apache/pinot/pull/12343#discussion_r1475062186


##########
pinot-server/src/main/java/org/apache/pinot/server/starter/helix/SegmentOnlineOfflineStateModelFactory.java:
##########
@@ -151,12 +156,14 @@ public void onBecomeDroppedFromConsuming(Message message, 
NotificationContext co
       
_logger.info("SegmentOnlineOfflineStateModel.onBecomeDroppedFromConsuming() : " 
+ message);
       String realtimeTableName = message.getResourceName();
       String segmentName = message.getPartitionName();
-      TableDataManager tableDataManager = 
_instanceDataManager.getTableDataManager(realtimeTableName);
-      Preconditions.checkState(tableDataManager != null, "Failed to find 
table: %s", realtimeTableName);
-      tableDataManager.onConsumingToDropped(segmentName);
       try {
         _instanceDataManager.offloadSegment(realtimeTableName, segmentName);
         _instanceDataManager.deleteSegment(realtimeTableName, segmentName);
+        // At this point ingestion thread should be stopped, we notify 
tableManager so it can remove its resources
+        // safely
+        TableDataManager tableDataManager = 
_instanceDataManager.getTableDataManager(realtimeTableName);
+        Preconditions.checkState(tableDataManager != null, "Failed to find 
table: %s", realtimeTableName);
+        tableDataManager.onConsumingToDropped(segmentName);

Review Comment:
   I feel that we should also change the method name `onConsumingToDropped` to 
`onConsumingToDroppedOrOffline`. Otherwise, the name is mis-leading



-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to