timoninmaxim commented on a change in pull request #9780:
URL: https://github.com/apache/ignite/pull/9780#discussion_r795594092
##########
File path:
modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java
##########
@@ -988,6 +988,8 @@ public void rollbackUserIndex(String idxName) {
GridH2IndexBase rmvIdx = tmpIdxs.remove(idxName);
assert rmvIdx != null;
+
+ rmvIdx.destroy(true);
Review comment:
Indexes creation is part of `SchemaManager#createIndex`:
```
final GridH2IndexBase h2Idx = desc.createUserIndex(idxDesc, cacheVisitor);
```
This method `rollbackUserIndex` is executed iff a SQL query statement fails
(try-catch block). But test halts and failes earlier in `desc.createUserIndex`.
Then, index isn't registered in table due to an exception in
`FailBuildIndexConsumer`, and then it becomes an orphaned index. Then it is not
cleaned along with tables in moment of a cache stop. It looks like a bug.
There is a method `IndexProcessor#destroyOrphanIndex` for such indexes. I
see that it actually uses only by special command, but maybe it's possible to
reuse this metod and clean such indexes on cache stop.
WDYT?
--
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]