While trying to import a large amount of entities (500k~) using:
./graql console -b entities.gql
and a large amount of relationships (600k~) between those entities using:
./graql console -b relationships.gql
I noticed Grakn was trying to create relationships between entities that shouldn’t have any relationship. Each entity is given a UUID attribute and somehow Grakn was mixing them up.
In an effort to try to figure out what’s going on I created a little program which imports entities and then right after does a match for each insert it performed before. If it doesn’t find the entity then it fails. I started with 500K~ entities and ended up being able to reproduce the issue at 100 entities. Although it’s not as consistent with failing it still does it ~4/5 times.
I’m using Ubuntu 16.04 and Grakn 1.2.0.
I’ve uploaded the project able to reproduce it here: https://github.com/BFergerson/grakn-import-verifier
- Import script: https://github.com/BFergerson/grakn-import-verifier/blob/master/src/main/java/VerifyImport.java
- Grakn schema: https://github.com/BFergerson/grakn-import-verifier/blob/master/grakn-schema.gql
- Import file: https://github.com/BFergerson/grakn-import-verifier/blob/master/entities.gql
I’m trying to look into this to find out what it could possibly be but since it’s inconsistent I’ve not been able to. It seems to work the best after I restart my computer. Not exactly a pleasant solution but even that isn’t 100 effective.
If you run this and it works the first time please try again after:
./grakn server stop && ./grakn server clean && ./grakn server start
Try at least 3 times. I haven’t been able to make it fail on command yet.