Damaged / lost relationships in Neo4J

I'm trying to do some refactoring work in my database (creating new relationships between nodes to speed up some queries), but caused an exception from memory because I underestimated the number of nodes (stupid mistake on Friday Friday when I pay on Monday). The request did not complete, but caused the database to fail, and a server restart was required.

Now I'm trying to rerun the request, but it seems that some of my data was corrupted or some nodes were left orphaned (perhaps because the transaction did not have time to roll back).

Does anyone have experience with this error or tips for fixing it?

This is an alpha-semi-prod database, for which I have nightly backups (and a very small set of users), and therefore I would not want to resort to backing up and thus save data.

The error I am encountering is:

While loading relationships for Node[1020530] a Relationship[3372448] was encountered that had startNode: 1865693 and endNode: 1769485, i.e. which had neither start nor end node as the node we're loading relationships for

Request (included for completeness):

CALL apoc.periodic.commit(
  'MATCH (a:Address)-[:IN]->(c:City) WHERE not((a)-[:ADDR_IN_CITY]->(:City)) WITH a, c LIMIT {limit} CREATE (a)-[:ADDR_IN_CITY]->(c) RETURN COUNT(c) as c_count',
  { limit: 1000 }
)
+4
source share

Source: https://habr.com/ru/post/1679643/


All Articles