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

'Relationship[nnn] in use error' when issuing concurrent Cypher DELETE queries when cache is enabled #4

Closed
lassewesth opened this issue Nov 12, 2012 · 4 comments

Comments

@lassewesth
Copy link
Member

@blevine: 'Environment:
Neo4j 1.8GA (also repro on 1.9 M01)
Ubuntu 12.04
Java:
java version "1.6.0_32"
Java(TM) SE Runtime Environment (build 1.6.0_32-b05)
Java HotSpot(TM) 64-Bit Server VM (build 20.7-b02, mixed mode)
Hardware:
Quad core home-brew, 8 G memory

I have a test that is designed to test out a retry strategy for dealing with deadlock exceptions. The test creates 50 nodes and multiple relationships between one node and the next node. It then issues 50 DELETE queries against each of these nodes. The specific DELETE query is:

START n = node({neoId}) MATCH n-[r?]-() DELETE r, n

Some of these queries produce the error: "Relationship[nnn] not in use"

Once this error is seen, any Cypher query that would encounter that relationship returns the error:

"Relationship[nnn] not found. This can be because someone else deleted this entity while we were trying to read properties from it, or because of concurrent modification of other properties on this entity. The problem should be temporary."

For example, the query:

START r = rel(*) return r 

will return this error. Also note that the query

START r = rel(*) return count(*) 

will return a non-zero value even though all of the relationships should have been deleted.

This condition persists until the database is restarted.

This appears to be a caching issue. When the node cache is disabled by setting cache_type=none, this problem does not occur.

I have a test (requires Node.js) that reproduces this problem at https://github.com/blevine/neo4j-concurrent-delete-test. The conc directory contains a full Node.js project. You should be able to cd into conc and run npm test. Or if you don't have npm installed, cd into conc and run node index.js'

@lassewesth
Copy link
Member Author


strings:

@lassewesth
Copy link
Member Author

@wfreeman: +1. I've seen the same thing. Requires server restart to clear sometimes.

@lassewesth
Copy link
Member Author

@peterneubauer: THanks for reporting, @jakewins is wokring on it.

@jakewins
Copy link
Contributor

jakewins commented Mar 4, 2013

This is fixed in Neo4j 1.8.2 and in upcoming 1.9 :)

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

No branches or pull requests

2 participants