<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/blevine/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/blevine">@blevine</a>: 'This is expands on the issue I originally raised here: <a href="https://groups.google.com/d/topic/neo4j/-Ml0NDjKDQA/discussion" rel="nofollow">https://groups.google.com/d/topic/neo4j/-Ml0NDjKDQA/discussion</a></p>
<p dir="auto">Environment:</p>
<ul dir="auto">
<li>Neo4j Community 1.8RC1</li>
<li>Ubuntu 12.04</li>
<li>Oracle JDK 1.6.0_32</li>
</ul>
<p dir="auto">I've come up with a relatively easy way to reproduce this issue without requiring you to replicate my Node.js environment.</p>
<p dir="auto">I was able to reproduce the problem fairly easily  by running an Apache Benchmark (ab) script that issued a "delete all nodes" Cypher query repeatedly and concurrently:</p>
<p dir="auto">ab -c 10 -n 10000 -v3 -T "application/json" -p delete.json  <a href="http://localhost:747" rel="nofollow">http://localhost:747</a><br>
4/db/data/cypher</p>
<p dir="auto">The delete .json file looks like:</p>
<p dir="auto">{<br>
"query" : "start n = node(*) DELETE n"<br>
}</p>
<p dir="auto">Instructions for reproducing the problem:</p>
<ol dir="auto">
<li>Bring up the neo4j console in a browser and navigate to the Data Browser tab. Be ready to start clicking the "+ Node" button to create new Nodes.</li>
<li>Start the ab script and immediately start clicking the "+Node"  button repeatedly while the ab script is working to delete all nodes.</li>
</ol>
<p dir="auto">Eventually, the ab script will start reporting errors of the form shown below. You can of course, increase the run time of the ab script if the problem doesn't appear right away. For me, it appeared after about 2 seconds. After that point, the "delete all nodes" query will continue to return this error.</p>
<p dir="auto">I also noticed some additional interesting behavior after this error occurred:</p>
<ol dir="auto">
<li>The console said that there were 24 nodes, but 'start n = node(*) return count(n)' returned 26.</li>
<li>The query 'start n = node(*) return n' produced an error: <em>"Node[214] not found. This can be because someone else deleted ..."</em> (note that Node 214 also appears in the original error below)</li>
</ol>
<p dir="auto">Error produced:</p>
<p dir="auto">{<br>
"message" : "NodeRecord[214] not in use",<br>
"exception" : "InvalidRecordException",<br>
"stacktrace" : [ "org.neo4j.kernel.impl.nioneo.store.NodeStore.getRecord(NodeStore.java:199)", "org.neo4j.kernel.impl.nioneo.store.NodeStore.getRecord(NodeStore.java:79)", "org.neo4j.kernel.impl.nioneo.xa.WriteTransaction.nodeDelete(WriteTransaction.java:661)", "org.neo4j.kernel.impl.persistence.PersistenceManager.nodeDelete(PersistenceManager.java:134)", "org.neo4j.kernel.impl.core.NodeManager.deleteNode(NodeManager.java:922)", "org.neo4j.kernel.impl.core.NodeImpl.delete(NodeImpl.java:282)", "org.neo4j.kernel.impl.core.NodeProxy.delete(NodeProxy.java:67)", "org.neo4j.cypher.internal.mutation.DeleteEntityAction.org$neo4j$cypher$internal$mutation$DeleteEntityAction$$delete(DeleteEntityAction.scala:50)", "org.neo4j.cypher.internal.mutation.DeleteEntityAction.exec(DeleteEntityAction.scala:34)", "org.neo4j.cypher.internal.mutation.DeleteEntityAction.exec(DeleteEntityAction.scala:30)", "org.neo4j.cypher.internal.pipes.ExecuteUpdateCommandsPipe.org$neo4j$cypher$internal$pipes$ExecuteUpdateCommandsPipe$$exec(ExecuteUpdateCommandsPipe.scala:52)", "org.neo4j.cypher.internal.pipes.ExecuteUpdateCommandsPipe$$anonfun$org$neo4j$cypher$internal$pipes$ExecuteUpdateCommandsPipe$$executeMutationCommands$1$$anonfun$apply$1.apply(ExecuteUpdateCommandsPipe.scala:43)", "org.neo4j.cypher.internal.pipes.ExecuteUpdateCommandsPipe$$anonfun$org$neo4j$cypher$internal$pipes$ExecuteUpdateCommandsPipe$$executeMutationCommands$1$$anonfun$apply$1.apply(ExecuteUpdateCommandsPipe.scala:43)", "scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:200)", "scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:200)", "scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)", "scala.collection.immutable.List.foreach(List.scala:45<br>
....</p>
<p dir="auto">'</p>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/blevine/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/blevine">@blevine</a>: 'Environment:<br>
Neo4j Communit 1.8GA<br>
Ubuntu 12.04<br>
Oracle JDK 1.6.0_32-b05<br>
Node.js/node-neo4j driver</p>
<p dir="auto">This problem is most likely related to issue <a href="https://github.com/neo4j/community/issues/872">#872</a>. After running a similar test for a while, I see the following error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&quot;Node[1877] concurrently deleted while loading its relationships?&quot;"><pre class="notranslate"><code class="notranslate">"Node[1877] concurrently deleted while loading its relationships?"
</code></pre></div>
<p dir="auto">as a result of the following 'delete all' query:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="start n = node(*) match n-[r?]-() delete r,n"><pre class="notranslate"><code class="notranslate">start n = node(*) match n-[r?]-() delete r,n
</code></pre></div>
<p dir="auto">At this point all attempts to execute that query (both programmatically and from the Data Browser) result in the same error. Nothing appears in the log related to this error.</p>
<p dir="auto">I then went to the Data Browser and was able to view Node 1877 although all of its properties had been deleted.  I then restarted the server after which Node 1877 disappeared (according to the Data Browser).  I was then able to issue the 'delete all' query successfully.'</p>