You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is possible to drop or rebuild an index that is obviously empty.
Actual behavior
We updated our OrientDB version from 3.2.6 to 3.2.14 having problems to create new vertices because of many changes (refactorings) in the index transaction parts (see commits in the diff from August and December 2022).
What was our problem: during a database transaction we are creating a vertex and in further steps request those vertex by using an automatic index of that vertex type. After upgrading to from 3.2.6 to 3.2.14 that index request does not work anymore because of this code in class OIndexOneValue
As you can see in the marked lines, if nothing found in the storage AND the apiVersion of the index == 0 an emtpy stream is returned!
Why was this change made?
(Before that change in case of a not found storage entry, the code "looks" into the current transaction index changes and returns the correct index entry).
So we decided to rebuild our index to get the apiVersion == 1. If you look at the code: if apiVersion==1 the code "looks" into the storage and - if nothing found - goes further to get the index entry from the current transaction index changes (which is the wished behaviour).
BUT:
We cannot drop the index, because we always get a: com.orientechnologies.orient.core.exception.NotEmptyComponentCanNotBeRemovedException: <our_index> : Not empty index can not be deleted. Index has 110 records at com.orientechnologies.orient.core.storage.index.sbtree.local.v1.OSBTreeV1.lambda$delete$4(OSBTreeV1.java:512) ~[orientdb-core-3.2.14.jar:3.2.14] at com.orientechnologies.orient.core.storage.impl.local.paginated.atomicoperations.OAtomicOperationsManager.executeInsideComponentOperation(OAtomicOperationsManager.java:165) ~[orientdb-core-3.2.14.jar:3.2.14] at com.orientechnologies.orient.core.storage.impl.local.paginated.atomicoperations.OAtomicOperationsManager.executeInsideComponentOperation(OAtomicOperationsManager.java:157) ~[orientdb-core-3.2.14.jar:3.2.14] at com.orientechnologies.orient.core.storage.impl.local.paginated.base.ODurableComponent.executeInsideComponentOperation(ODurableComponent.java:102) ~[orientdb-core-3.2.14.jar:3.2.14] at com.orientechnologies.orient.core.storage.index.sbtree.local.v1.OSBTreeV1.delete(OSBTreeV1.java:504) ~[orientdb-core-3.2.14.jar:3.2.14] at com.orientechnologies.orient.core.storage.index.engine.OSBTreeIndexEngine.delete(OSBTreeIndexEngine.java:134) ~[orientdb-core-3.2.14.jar:3.2.14] at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.deleteIndexEngineInternal(OAbstractPaginatedStorage.java:2930) ~[orientdb-core-3.2.14.jar:3.2.14] at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.lambda$deleteIndexEngine$14(OAbstractPaginatedStorage.java:2893) ~[orientdb-core-3.2.14.jar:3.2.14] at com.orientechnologies.orient.core.storage.impl.local.paginated.atomicoperations.OAtomicOperationsManager.executeInsideAtomicOperation(OAtomicOperationsManager.java:140) ~[orientdb-core-3.2.14.jar:3.2.14] at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.deleteIndexEngine(OAbstractPaginatedStorage.java:2889) ~[orientdb-core-3.2.14.jar:3.2.14] at com.orientechnologies.orient.core.index.OIndexAbstract.doDelete(OIndexAbstract.java:698) ~[orientdb-core-3.2.14.jar:3.2.14] at com.orientechnologies.orient.core.index.OIndexAbstract.delete(OIndexAbstract.java:661) ~[orientdb-core-3.2.14.jar:3.2.14] at com.orientechnologies.orient.core.index.OIndexAbstract.delete(OIndexAbstract.java:76) ~[orientdb-core-3.2.14.jar:3.2.14] at com.orientechnologies.orient.core.index.OIndexManagerShared.dropIndex(OIndexManagerShared.java:869) ~[orientdb-core-3.2.14.jar:3.2.14]
which is not true.
We cleared the index before dropping it. Before clearing we have over 6 million entries (using index.getSize()), after clearing it the size is 0 (due to index.getSize()) - but dropping is impossible!
So how can we solve this problem? ATM we are not able to upgrade to a newer OrientDB version to benefit from the bug fix #9821 from 3.2.14 because of the index behaviour changes.
Thanks,
J.
The text was updated successfully, but these errors were encountered:
OrientDB Version: 3.2.14
Java Version: 17.0.5+8
OS: Windows 10
Expected behavior
It is possible to drop or rebuild an index that is obviously empty.
Actual behavior
We updated our OrientDB version from 3.2.6 to 3.2.14 having problems to create new vertices because of many changes (refactorings) in the index transaction parts (see commits in the diff from August and December 2022).
What was our problem: during a database transaction we are creating a vertex and in further steps request those vertex by using an automatic index of that vertex type. After upgrading to from 3.2.6 to 3.2.14 that index request does not work anymore because of this code in class OIndexOneValue
As you can see in the marked lines, if nothing found in the storage AND the apiVersion of the index == 0 an emtpy stream is returned!
Why was this change made?
(Before that change in case of a not found storage entry, the code "looks" into the current transaction index changes and returns the correct index entry).
So we decided to rebuild our index to get the apiVersion == 1. If you look at the code: if apiVersion==1 the code "looks" into the storage and - if nothing found - goes further to get the index entry from the current transaction index changes (which is the wished behaviour).
BUT:
We cannot drop the index, because we always get a:
com.orientechnologies.orient.core.exception.NotEmptyComponentCanNotBeRemovedException: <our_index> : Not empty index can not be deleted. Index has 110 records at com.orientechnologies.orient.core.storage.index.sbtree.local.v1.OSBTreeV1.lambda$delete$4(OSBTreeV1.java:512) ~[orientdb-core-3.2.14.jar:3.2.14] at com.orientechnologies.orient.core.storage.impl.local.paginated.atomicoperations.OAtomicOperationsManager.executeInsideComponentOperation(OAtomicOperationsManager.java:165) ~[orientdb-core-3.2.14.jar:3.2.14] at com.orientechnologies.orient.core.storage.impl.local.paginated.atomicoperations.OAtomicOperationsManager.executeInsideComponentOperation(OAtomicOperationsManager.java:157) ~[orientdb-core-3.2.14.jar:3.2.14] at com.orientechnologies.orient.core.storage.impl.local.paginated.base.ODurableComponent.executeInsideComponentOperation(ODurableComponent.java:102) ~[orientdb-core-3.2.14.jar:3.2.14] at com.orientechnologies.orient.core.storage.index.sbtree.local.v1.OSBTreeV1.delete(OSBTreeV1.java:504) ~[orientdb-core-3.2.14.jar:3.2.14] at com.orientechnologies.orient.core.storage.index.engine.OSBTreeIndexEngine.delete(OSBTreeIndexEngine.java:134) ~[orientdb-core-3.2.14.jar:3.2.14] at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.deleteIndexEngineInternal(OAbstractPaginatedStorage.java:2930) ~[orientdb-core-3.2.14.jar:3.2.14] at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.lambda$deleteIndexEngine$14(OAbstractPaginatedStorage.java:2893) ~[orientdb-core-3.2.14.jar:3.2.14] at com.orientechnologies.orient.core.storage.impl.local.paginated.atomicoperations.OAtomicOperationsManager.executeInsideAtomicOperation(OAtomicOperationsManager.java:140) ~[orientdb-core-3.2.14.jar:3.2.14] at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.deleteIndexEngine(OAbstractPaginatedStorage.java:2889) ~[orientdb-core-3.2.14.jar:3.2.14] at com.orientechnologies.orient.core.index.OIndexAbstract.doDelete(OIndexAbstract.java:698) ~[orientdb-core-3.2.14.jar:3.2.14] at com.orientechnologies.orient.core.index.OIndexAbstract.delete(OIndexAbstract.java:661) ~[orientdb-core-3.2.14.jar:3.2.14] at com.orientechnologies.orient.core.index.OIndexAbstract.delete(OIndexAbstract.java:76) ~[orientdb-core-3.2.14.jar:3.2.14] at com.orientechnologies.orient.core.index.OIndexManagerShared.dropIndex(OIndexManagerShared.java:869) ~[orientdb-core-3.2.14.jar:3.2.14]
which is not true.
We cleared the index before dropping it. Before clearing we have over 6 million entries (using index.getSize()), after clearing it the size is 0 (due to index.getSize()) - but dropping is impossible!
So how can we solve this problem? ATM we are not able to upgrade to a newer OrientDB version to benefit from the bug fix #9821 from 3.2.14 because of the index behaviour changes.
Thanks,
J.
The text was updated successfully, but these errors were encountered: