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

apoc.export.cypher.all violates unique constraint when rewriting nodes at the same time #131

Closed
neo-technology-build-agent opened this issue Sep 1, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@neo-technology-build-agent
Copy link
Collaborator

Issue by Pils19
Monday Dec 10, 2018 at 09:27 GMT
Originally opened as neo4j-contrib/neo4j-apoc-procedures#1014


I was exporting a big graph to cypher with the following query.
call apoc.export.cypher.all(null {format:"plain",separateFiles:true,streamStatements:true,batchSize:100})
While i was exporting the graph there was heavy write on the graph that included deleting & recreating nodes that have an unique constraint on one property. I expected that the graph is exported as it is to the time where i started the export.

But when i tried to write the data to a fresh neo4j instance (order: nodes, schema, relations). I got an error when i tried to apply the schema opertations on the graph. The error is an neo4j.exceptions.DatabaseError: Unable to create CONSTRAINT ON [...] error. The graph was empty before. I checked the database on which the import failed and saw the following, there where about 10 nodes that are duplicated. All of these nodes were deleted and rewritten, while i was exporting the graph.

I would assume that there is no lock or something else while exporting? Which leads to duplicate node create queries on import?

  1. To reproduce the problem just create a big graph fill it with random data and read nodes, delete them, rewrite them randomly while exporting to cypher.
  2. Try to reimport the exported cypher queries to a fresh graph (order nodes, schema, relations). Error should occur.

Neo4j version: 3.4.9-enterprise (Docker)
Neo4j-Apoc version: 3.4.0.4

@gem-neo4j gem-neo4j added the bug Something isn't working label Apr 19, 2023
@JoelBergstrand
Copy link
Contributor

Neo4j 3.4 and Apoc 3.4 reached EoL in May 2022 and does not receive further support. Let us know if you experience similar issues on current versions of Neo4j. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants