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

OClass.INDEX_TYPE.UNIQUE allows duplicates #8526

Closed
diaconescur opened this issue Sep 11, 2018 · 0 comments
Closed

OClass.INDEX_TYPE.UNIQUE allows duplicates #8526

diaconescur opened this issue Sep 11, 2018 · 0 comments

Comments

@diaconescur
Copy link

diaconescur commented Sep 11, 2018

OrientDB Version: Community edition 2.2.34 - cluster of 3 nodes;

Java Version: 1.8.0_172

OS: Windows 10

Expected behavior

We have multiple classes having a OType.STRING property as part of an unique index (OClass.INDEX_TYPE.UNIQUE). No duplicates should ever be inserted.

Actual behavior

We find in our db multiple records with the same value in this property.
The select:
select * from MyNodeClass where uniqueId='uniqueValue'
returns nothing;
The select by RID:
select from #153:693002
select from #155:713445
Brings both records, having the same string in the uniqueId.
An index rebuild obviously fails with:
Error: com.orientechnologies.orient.core.storage.ORecordDuplicatedException:
Cannot index record #153:693002: found duplicated key 'uniqueValue' in index 'MyNodeClass.uniqueId' previously assigned to the record #155:713445
DB name="myDb" INDEX=MyNodeClass.uniqueId RID=#155:713445

The node insert is performed in a transaction:
OrientGraphFactory factory = new OrientGraphFactory(...);
OrientGraph graph =factory.getTx();
factory.addVertex(...);
factory.commit();
factory.shutdown();

Steps to reproduce

Not clear how this happens. For weeks/months the application runs ok (normal behavior) and at some point we find this problems. Any idea what might cause this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants