Ghost nodes

When attempting to index the graph (I utilize Linkurious), it returned the following error

Database elements (nodes, relationships, properties) were observed during query execution, but got deleted by an overlapping committed transaction before the query results could be serialised. The transaction might succeed if it is retried.

I created approximately six million nodes with a tag SAR. When creating relationships between nodes with tag SAR, the query took over five days with no end in sight so I killed it. I wanted to DETACH DELETE all nodes tagged with SAR including relationships in order to start over.

I have deleted all the nodes technically with
MATCH (n:SAR)
WITH n LIMIT 10000
DETACH DELETE n

However, they still exist somehow and I cannot use an index or property to MATCH them and delete them. Is there a way to completely eliminate nodes of this type without deleting the whole database and starting over? I use Neo4j browser community edition.

For example, if I do say
MATCH (n) WHERE n.name CONTAINS "x" DETACH DELETE RETURN n LIMIT 500

It returns 500 (I tried specifying RETURN n.name, id(n) as well)

Then when I try

MATCH (n) WITH n LIMIT 1000 WHERE n.name CONTAINS "x" DETACH DELETE n

I only deleted five (the five that weren't part of the set I'm trying to delete)

Hi @mkretsch ,

Could you clarify whether or not nodes with the label :SAR exist? For example,
what does this return...

MATCH (n:SAR) RETURN count(n)

The first query you mention should be fine for detach delete'ing nodes in batches of 10000. You might want to use something like apoc periodic execution to continually run the query until everything is deleted.

For example:

CALL apoc.periodic.commit(
  "MATCH (n:SAR)
   WITH n LIMIT $limit
   DETACH DELETE n
   RETURN count(*)",
  {limit:10000})

Best,
ABK

Hi @abk!

Right now MATCH (n:SAR) RETURN count(n)
Returns 0

With apoc.periodic.commit I was able to delete all the nodes so the total count of nodes is accurate. However, I still receive this error

"Database elements (nodes, relationships, properties) were observed during query execution, but got deleted by an overlapping committed transaction before the query results could be serialised. The transaction might succeed if it is retried."

I have copied the database and begun a new one, same issue prevails.

What query are you running when you receive that error? Is it when you try to create the index? Could you suggest steps which would reproduce the situation?

Best,
ABK

I receive the error in two scenarios.
1.
MATCH (n:SAR)
RETURN n LIMIT 5

  1. When trying to index the graph when using Linkurious (the visualization software we use for the neo4j graph)

I have tried removing SAR from the index, but it says no such index exists. Does that help solve what might be happening?

Additionally, where I think the issue started was when I was working with neo4j in Docker on an AWS server with very low memory. I had gone from a database of several hundred thousand nodes and added approximately six million nodes. Then I attempted to put relationships between them, importing from a csv (in iterations) but it never completed. I think attempted to delete all the nodes and start over, and that is when I started to encounter issues.

I was able to solve the issue using store utils. Thank you so much for offering to help out!