AMashenkov commented on code in PR #3358:
URL: https://github.com/apache/ignite-3/pull/3358#discussion_r1523416882
##########
modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java:
##########
@@ -198,6 +195,48 @@ private CompletableFuture<Boolean>
onIndexCreate(CreateIndexEventParameters para
});
}
+ private void onIndexRemoved(RemoveIndexEventParameters parameters) {
+ inBusyLock(busyLock, () -> {
+ int indexId = parameters.indexId();
+ int catalogVersion = parameters.catalogVersion();
+ int previousCatalogVersion = catalogVersion - 1;
+
+ // Retrieve descriptor during synchronous call, before the
previous catalog version could be concurrently compacted.
+ CatalogIndexDescriptor indexDescriptor =
catalogService.index(indexId, previousCatalogVersion);
+ assert indexDescriptor != null : "indexId=" + indexId + ",
catalogVersion=" + previousCatalogVersion;
+
+ int tableId = indexDescriptor.tableId();
+
+ if (catalogService.table(tableId, catalogVersion) == null) {
+ // Nothing to do. Index will be destroyed along with the table.
+ return;
+ }
+
+ destructionEventsQueue.enqueue(new
DestroyIndexEvent(catalogVersion, indexId, tableId));
Review Comment:
This code is called for a the new CatalogVersion, which is not ready yet.
An index is `alive` in the actual Catalog version (relative to LWM
timestamp), so it will not be cleaned by LWM listener.
Thus we can't call onLwmChange synchronously here not only because of
Metastorage thread.
Maybe we could schedule onLwmChange inside a continuation to the current
Catalog ready future.
--
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]