【发布时间】:2014-01-20 16:14:55
【问题描述】:
我有一个 neo4j 数据库,其中包含数百万个节点和几乎一样多的关系。在运行向其添加数据的程序时,JVM 似乎已经崩溃。当我后来尝试使用索引查询数据库时,它正常打开并检索了一些节点,但在某些时候返回了以下错误:
线程“主”org.neo4j.graphdb.NotFoundException 中的异常: 未找到节点 [20924]。这可能是因为其他人删除了此 当我们试图从中读取属性时,或者因为 同时修改此实体上的其他属性。这 问题应该是暂时的。在 org.neo4j.kernel.impl.core.Primitive.ensureFullProperties(Primitive.java:601) 在 org.neo4j.kernel.impl.core.Primitive.ensureFullProperties(Primitive.java:579) 在 org.neo4j.kernel.impl.core.Primitive.hasProperty(Primitive.java:309) 在 org.neo4j.kernel.impl.core.NodeImpl.hasProperty(NodeImpl.java:53) 在 org.neo4j.kernel.impl.core.NodeProxy.hasProperty(NodeProxy.java:160) 在 org.neo4j.cypher.internal.spi.gdsimpl.GDSBackedQueryContext$$anon$1.hasProperty(GDSBackedQueryContext.scala:66) 在 org.neo4j.cypher.internal.spi.gdsimpl.GDSBackedQueryContext$$anon$1.hasProperty(GDSBackedQueryContext.scala:48) 在 org.neo4j.cypher.internal.commands.Has.isMatch(Predicate.scala:203) 在 org.neo4j.cypher.internal.pipes.FilterPipe$$anonfun$internalCreateResults$1.apply(FilterPipe.scala:30) 在 org.neo4j.cypher.internal.pipes.FilterPipe$$anonfun$internalCreateResults$1.apply(FilterPipe.scala:30) 在 scala.collection.Iterator$$anon$14.hasNext(Iterator.scala:390) 在 scala.collection.Iterator$class.foreach(Iterator.scala:727) 在 scala.collection.AbstractIterator.foreach(Iterator.scala:1156) 在 org.neo4j.cypher.internal.pipes.EagerAggregationPipe.internalCreateResults(EagerAggregationPipe.scala:76) 在 org.neo4j.cypher.internal.pipes.PipeWithSource.createResults(Pipe.scala:69) 在 org.neo4j.cypher.internal.pipes.PipeWithSource.createResults(Pipe.scala:66) 在 org.neo4j.cypher.internal.executionplan.ExecutionPlanImpl.org$neo4j$cypher$internal$executionplan$ExecutionPlanImpl$$prepareStateAndResult(ExecutionPlanImpl.scala:164) 在 org.neo4j.cypher.internal.executionplan.ExecutionPlanImpl$$anonfun$getLazyReadonlyQuery$1.apply(ExecutionPlanImpl.scala:139) 在 org.neo4j.cypher.internal.executionplan.ExecutionPlanImpl$$anonfun$getLazyReadonlyQuery$1.apply(ExecutionPlanImpl.scala:138) 在 org.neo4j.cypher.internal.executionplan.ExecutionPlanImpl.execute(ExecutionPlanImpl.scala:38) 在 org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:72) 在 org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:67) 在 org.neo4j.cypher.javacompat.ExecutionEngine.execute(ExecutionEngine.java:66) 在 querygraph.BasicStatsQueries.main(BasicStatsQueries.java:54) 引起:org.neo4j.kernel.impl.nioneo.store.InvalidRecordException: PropertyRecord[11853043] 未在使用 org.neo4j.kernel.impl.nioneo.store.PropertyStore.getRecord(PropertyStore.java:453) 在 org.neo4j.kernel.impl.nioneo.store.PropertyStore.getLightRecord(PropertyStore.java:306) 在 org.neo4j.kernel.impl.nioneo.xa.ReadTransaction.getPropertyRecordChain(ReadTransaction.java:185) 在 org.neo4j.kernel.impl.nioneo.xa.ReadTransaction.loadProperties(ReadTransaction.java:215) 在 org.neo4j.kernel.impl.nioneo.xa.ReadTransaction.nodeLoadProperties(ReadTransaction.java:239) 在 org.neo4j.kernel.impl.persistence.PersistenceManager.loadNodeProperties(PersistenceManager.java:111) 在 org.neo4j.kernel.impl.core.NodeManager.loadProperties(NodeManager.java:833) 在 org.neo4j.kernel.impl.core.NodeImpl.loadProperties(NodeImpl.java:143) 在 org.neo4j.kernel.impl.core.Primitive.ensureFullProperties(Primitive.java:596) ... 23 更多
只有一个线程(至少是我开始的)运行查询,而且都是读取,而不是写入。尽管异常声称它是临时的,但每次我尝试查询此索引时都会发生这种情况。因此,我认为这与糟糕的关机有关。在我实施代码以防止这种情况之前,我曾因强制关闭而导致数据库损坏,但 neo4j 始终能够恢复数据库,尽管这需要一段时间。这似乎更糟。
当我手动循环遍历索引并添加一个 try-catch 时,它开始为索引中在上面列出的节点之后的每个节点返回错误。这是否意味着所有这些节点都不存在或已损坏?这将意味着大量(大量)数据丢失,因为索引中应该有大约一百万个节点。我可以做些什么来恢复数据库?
我正在使用 1.9.2,并且很想升级以使用标签等,但我现在需要这个数据库来完成一些时间紧迫的工作,并且现在没有时间进行任何重大更改。
非常感谢您的任何帮助。
【问题讨论】:
标签: java neo4j corruption