AMashenkov commented on code in PR #1067:
URL: https://github.com/apache/ignite-3/pull/1067#discussion_r975199544
##########
modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java:
##########
@@ -254,55 +232,54 @@ public CompletableFuture<Boolean> dropIndexAsync(
try {
validateName(indexName);
- String canonicalName = canonicalName(schemaName, indexName);
+ String canonicalName =
parseCanonicalName(canonicalName(schemaName, indexName));
- Index<?> index = indexByName.get(canonicalName);
+ TableIndexConfiguration idxCfg =
tablesCfg.indexes().get(canonicalName);
- if (index == null) {
+ if (idxCfg == null) {
return failIfNotExists
? CompletableFuture.failedFuture(new
IndexNotFoundException(canonicalName))
: CompletableFuture.completedFuture(false);
}
- CompletableFuture<Boolean> future = new CompletableFuture<>();
+ final CompletableFuture<Boolean> future = new
CompletableFuture<>();
- tableManager.tableAsyncInternal(index.tableId(),
false).thenAccept((table) -> {
- if (table == null) {
- var exception = new IndexNotFoundException(canonicalName);
+ final UUID tableId = idxCfg.tableId().value();
- LOG.info("Unable to drop index [schema={}, index={}]",
- exception, schemaName, indexName);
+ tablesCfg.indexes().change(indexListChange -> {
+ TableView tableView =
getByInternalId(tablesCfg.tables().value(), tableId);
+
+ if (tableView == null) {
+ var exception = new TableNotFoundException(canonicalName);
Review Comment:
No exception is expected when `failIfNotExists == false`.
Absence of table means the index is absent as well.
--
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]