graphaware / neo4j-uuid

GraphAware Runtime Module that assigns a UUID to all nodes (and relationships) in the graph transparently
103 stars 22 forks source link

Fix issue #34 - initialization batch process only on leader #39

Closed omarlarus closed 7 years ago

omarlarus commented 7 years ago

The "WARN" message is written during the initialization process. All the instances try to update all the nodes and relationships. It's very hard to write down a unit test about it, so I tested it manually on causal cluster 3.1.3 and community edition.

ikwattro commented 7 years ago

Thx @omarlarus sounds good.

As further improvement (might be another PR) we can have a property on the module class that holds the reindex status, as we do here for ex https://github.com/graphaware/neo4j-to-elasticsearch/blob/master/src/main/java/com/graphaware/module/es/ElasticSearchModule.java#L92

Then you can have procedure that checks if the database has been initialized or is in initialize state depending on the time it takes. https://github.com/graphaware/neo4j-to-elasticsearch/blob/master/src/main/java/com/graphaware/module/es/proc/ElasticSearchProcedures.java#L103

omarlarus commented 7 years ago

@ikwattro the problem occured when all the instances of the cluster started up at the same time, so they all tried to update the nodes without uuid property. Only leader can do it and then the others'll update. I don't think that a "reindex status" can help in this case because it needs to be coordinated across the instances.

ikwattro commented 7 years ago

@omarlarus Can you put the jar somewhere and link it to #34 so @albert-the-creator can test it ?