Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indexes are not deleted when deleting edges #9346

Open
Maklyura opened this issue Jul 23, 2020 · 3 comments
Open

Indexes are not deleted when deleting edges #9346

Maklyura opened this issue Jul 23, 2020 · 3 comments
Assignees
Labels
Milestone

Comments

@Maklyura
Copy link

Maklyura commented Jul 23, 2020

OrientDB Version: 3.1.1

Java Version: 1.8.0

OS: Linux

Expected behavior

Indexes must be deleted when deleting edges

Actual behavior

When deleting edges their indexes still exist and it causes "com.orientechnologies.orient.core.storage.ORecordDuplicatedException: Cannot index record #49:4: found duplicated key 'OCompositeKey{keys=[#47:47, #46:48]}' in index 'EMEdge.out_in' previously assigned to the record #48:3".

This error reproduces in: 3.1.0-beta1, 3.1.1, but not reproduces in 3.0.32.
An important note: I have message in log file says "Seems you use manual indexes. Manual indexes are deprecated , not supported any more and will be removed in next versions if you do not want to see warning, please set global property index.allowManualIndexesWarning to false".
But as documentation says, "To create an automatic index bound to the schema property, use the ON clause, or use a . name for the index. In order to create an index, the schema must already exist in your database." - and I use "ON" clause.

Steps to reproduce

CREATE CLASS EMVertex EXTENDS V
CREATE CLASS EMEdge EXTENDS E
CREATE VERTEX EMVertex (from vertex)
CREATE VERTEX EMVertex (to vertex)
CREATE PROPERTY EMEdge.in LINK
CREATE PROPERTY EMEdge.out LINK
CREATE INDEX G ON EMEdge ( out, in ) UNIQUE
CREATE EDGE EMEdge FROM #47:47 TO #46:48 (previously created vertexe's rids)
DELETE EDGE #48:3 (delete previously created edge)
SELECT FROM EMEdge (result - no edges)
SELECT FROM INDEX:G (result - index still exists)
CREATE EDGE EMEdge FROM #47:47 TO #46:48 (Cannot index record #49:4: found duplicated key 'OCompositeKey{keys=[#47:47, #46:48]}' in index 'G' previously assigned to the record #48:3").
REBUILD INDEX G
CREATE EDGE EMEdge FROM #47:47 TO #46:48 (edge creates properly)

@andrii0lomakin
Copy link
Member

Hi @Maklyura . This warning is about the fact that you access index directly, such access methods will be deprecated in next release. About the rest, that is definitely a bug. I am working to fix it.

@andrii0lomakin
Copy link
Member

The problem happens because in and out links of edges are marked as dirty, but their original values equal to null which is incorrect. Assigned to @tglman .

@Maklyura
Copy link
Author

Maklyura commented Aug 6, 2020

Hi @Maklyura . This warning is about the fact that you access index directly, such access methods will be deprecated in next release. About the rest, that is definitely a bug. I am working to fix it.

Thanks a lot for warning me about directly access indexes. I do not need it, It was just way to be sure that indexes are the cause, and I used it in example as easy way to show that indexes are still exist.

@andrii0lomakin andrii0lomakin reopened this Aug 6, 2021
@tglman tglman added this to the 3.1.x milestone Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants