jtao15 commented on a change in pull request #8422:
URL: https://github.com/apache/pinot/pull/8422#discussion_r838383274



##########
File path: 
pinot-server/src/main/java/org/apache/pinot/server/starter/helix/SegmentMessageHandlerFactory.java
##########
@@ -144,6 +147,23 @@ public HelixTaskResult handleMessage()
     }
   }
 
+  private class TableDeletionMessageHandler extends DefaultMessageHandler {
+    TableDeletionMessageHandler(TableDeletionMessage tableDeletionMessage, 
ServerMetrics metrics,
+        NotificationContext context) {
+      super(tableDeletionMessage, metrics, context);
+    }
+
+    @Override
+    public HelixTaskResult handleMessage()
+        throws InterruptedException {
+      HelixTaskResult helixTaskResult = new HelixTaskResult();
+      _logger.info("Handling message: {}", _message);
+      _instanceDataManager.deleteTable(_tableNameWithType);

Review comment:
       Good point, added the server metrics `DELETE_TABLE_FAILURES`.

##########
File path: 
pinot-server/src/main/java/org/apache/pinot/server/starter/helix/HelixInstanceDataManager.java
##########
@@ -184,18 +184,26 @@ private TableDataManager createTableDataManager(String 
tableNameWithType, TableC
     return tableDataManager;
   }
 
+  @Override
+  public void deleteTable(String tableNameWithType) {
+    _tableDataManagerMap.compute(tableNameWithType, (k, v) -> {
+      if (v != null) {
+        v.shutDown();

Review comment:
       The files on disk will be removed when the segment goes from `OFFLINE` 
to `DROPPED`, the clean up is based on table and segment name. We won’t have 
any issue if the tableDataManager is shutdown&removed before this state 
transition. But we will have the issue to go from `ONLINE` to `OFFLINE`, this 
is because segmentDataManger is destroyed via the tableDataManager for the 
state transition. As you mentioned in other comments, we need to make sure all 
segments are `OFFLINE/DROPPED` before removing the tableDataManager. Else we 
may have some resources unclosed.




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