snleee commented on a change in pull request #8422:
URL: https://github.com/apache/pinot/pull/8422#discussion_r838064064
##########
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:
What happens to the physical segment files on the server after we call
`shutdown()`?
##########
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:
Can we emit the metrics on delete table failure? I think that we should
at least emit the metric to indicate failure to cover the following case:
- we send the message to the server to drop table A from this line
- the server-side somehow fails to execute this message (but this doesn't
get caught on the controller side because the message gets executed
asynchronously)
- we remove other resources for this table and finish the table deletion.
- recreate table A
If the above case happens, the server will probably reuse the table data
manager from the old table.
--
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]