rpuch commented on code in PR #6329: URL: https://github.com/apache/ignite-3/pull/6329#discussion_r2239616500
########## modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java: ########## @@ -3275,34 +3278,79 @@ public int tableId() { private void cleanUpResourcesForDroppedTablesOnRecoveryBusy() { // TODO: IGNITE-20384 Clean up abandoned resources for dropped zones from vault and metastore - for (DroppedTableInfo droppedTableInfo : droppedTables(catalogService, lowWatermark.getLowWatermark())) { - int catalogVersion = droppedTableInfo.tableRemovalCatalogVersion() - 1; - Catalog catalog = catalogService.catalog(catalogVersion); + Set<Integer> aliveTableIds = aliveTables(catalogService, lowWatermark.getLowWatermark()); - CatalogTableDescriptor tableDescriptor = catalog.table(droppedTableInfo.tableId()); - assert tableDescriptor != null : "tableId=" + droppedTableInfo.tableId() + ", catalogVersion=" + catalogVersion; + destroyMvStoragesForTablesNotIn(aliveTableIds); - CatalogZoneDescriptor zoneDescriptor = catalog.zone(tableDescriptor.zoneId()); - assert zoneDescriptor != null : "zoneId=" + tableDescriptor.zoneId() + ", catalogVersion=" + catalogVersion; + if (!nodeProperties.colocationEnabled()) { + destroyTxStateStoragesForTablesNotIn(aliveTableIds); + destroyReplicationProtocolStoragesForTablesNotIn(aliveTableIds); + } + } - destroyTableOnRecoveryBusy(tableDescriptor, zoneDescriptor.partitions()); + private void destroyMvStoragesForTablesNotIn(Set<Integer> aliveTableIds) { + for (StorageEngine storageEngine : dataStorageMgr.allStorageEngines()) { + Set<Integer> tableIdsOnDisk = storageEngine.tableIdsOnDisk(); + + for (int tableId : difference(tableIdsOnDisk, aliveTableIds)) { + storageEngine.destroyMvTable(tableId); + LOG.info("Destroyed table MV storage for table {} in storage engine '{}'", tableId, storageEngine.name()); Review Comment: Table drop (and, subsequently, destruction) seems to be a rare operation. Even if someone creates and drops 100 tables per day (this seems a lot), this should not clutter the log -- 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: notifications-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org