cancel
Showing results for 
Search instead for 
Did you mean: 

Join the community at Nodes 2022, our free virtual event on November 16 - 17.

Exclusive locks - requests take a long time

Slawomir_Jaros
Node Link

I have many long term requests like:


MATCH (tx: Survey {uuid: {Id}}), (p: Person {personId: {personId}}), 
MATCH (d: Day {day: {day}})
MATCH (rs: Result {ResultId: {resultId}, isActual: true})
CREATE (ex: SurveyResult) 
CREATE (ex)-->(rs) 
CREATE (ex)-[:comesFrom]->(tx) 
CREATE (ex)-[:executedBy]->(p) 
CREATE (ex)-[:savedOn]->(d) WITH ex UNWIND {answers} AS answer MATCH (a:Answer {uuid: answer}) CREATE (ex)-[:respondedWith]->(a)"

with status=waiting with deadlocks (CALL dbms.listQueries()) like:

resourceInformation
{
"waitTimeMillis": 10788,
"lockMode": "EXCLUSIVE",
"resourceType": "NODE",
"resourceIds": [
8199666
]
}

Requests take a long time, they don't want to end. I checked resourceIds and they are the identifiers of Result objects. These objects are involved in both getSurvey and saveSurveyResult requests. What's wrong?

I'm using neo4jDriver 1.7.91 that is compatible with neo4j 3.6.2

1 ACCEPTED SOLUTION

Slawomir_Jaros
Node Link

This type of errors stopped appearing after adding index to the uuid field.

View solution in original post

2 REPLIES 2

Can you run an EXPLAIN of the query and add that here?

Also, there have been significant locking improvements with respect to relationship creation and deletion in 4.3.x. We'd recommend upgrading to 4.3.4 or later.

Slawomir_Jaros
Node Link

This type of errors stopped appearing after adding index to the uuid field.

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit - November 16 - 17, 2022.


Free NODES Training Series


October 19th -

Intro to Neo4j


October 20th -

Healthcare Analytics Using Neo4j


October 25th -

Handling Neo4j data with Apache Hop


October 26th -

Blazing Fast Graphs: Hands-on with Apache Arrow and Neo4j


November 2nd -

Graph EDA Using the Neo4j GDS Client