Neo4j 2.1.5增量备份失败但完全备份成功

时间:2014-11-26 14:25:34

标签: neo4j spring-data-neo4j

this问题非常相似,但我正在使用Java运行备份并使用本地嵌入式Neo4J 2.1.5 Enterprise实例。使用:

OnlineBackup backup = OnlineBackup.from(backupTarget);
backup.backup(backupDirectory);
if (!backup.isConsistent()) {
    ...
}

初始(完整)备份工作正常,但是后续增量备份运行失败(内部):

org.neo4j.consistency.ConsistencyCheckingError: Inconsistencies in transaction:
    Start[3,xid=GlobalId[NEOKERNL|9146491774354043793|781|-1], BranchId[ 52 49 52 49 52 49 ],master=-1,me=-1,time=2014-11-26 12:57:55.236+0000/1417006675236,lastCommittedTxWhenTransactionStarted=28650]
    2PC[3, txId=28651, 2014-11-26 12:57:55.254+0000/1417006675254]
    ConsistencySummaryStatistics{
        Number of errors: 2
        Number of warnings: 0
        Number of inconsistent RELATIONSHIP records: 2
    }

at org.neo4j.consistency.checking.incremental.intercept.CheckingTransactionInterceptor.complete(CheckingTransactionInterceptor.java:181) ~[neo4j-consistency-check-2.1.5.jar:2.1.5]
    at org.neo4j.kernel.impl.transaction.xaframework.LogEntryVisitorAdapter.apply(LogEntryVisitorAdapter.java:62) ~[neo4j-kernel-2.1.5.jar:2.1.5]
    at org.neo4j.kernel.impl.transaction.xaframework.LogEntryVisitorAdapter.apply(LogEntryVisitorAdapter.java:28) ~[neo4j-kernel-2.1.5.jar:2.1.5]
    at org.neo4j.kernel.impl.nioneo.xa.command.LogFilter.endLog(LogFilter.java:87) ~[neo4j-kernel-2.1.5.jar:2.1.5]
    at org.neo4j.kernel.impl.transaction.xaframework.XaLogicalLog.applyTransaction(XaLogicalLog.java:1121) ~[neo4j-kernel-2.1.5.jar:2.1.5]
    at org.neo4j.kernel.impl.transaction.xaframework.XaResourceManager.applyCommittedTransaction(XaResourceManager.java:866) ~[neo4j-kernel-2.1.5.jar:2.1.5]
    at org.neo4j.kernel.impl.transaction.xaframework.XaDataSource.applyCommittedTransaction(XaDataSource.java:246) ~[neo4j-kernel-2.1.5.jar:2.1.5]
    at org.neo4j.com.ServerUtil.applyReceivedTransactions(ServerUtil.java:461) ~[neo4j-com-2.1.5.jar:2.1.5]
    at org.neo4j.backup.BackupService.unpackResponse(BackupService.java:423) ~[neo4j-backup-2.1.5.jar:2.1.5]
    at org.neo4j.backup.BackupService.incrementalWithContext(BackupService.java:330) ~[neo4j-backup-2.1.5.jar:2.1.5]
    at org.neo4j.backup.BackupService.doIncrementalBackup(BackupService.java:269) ~[neo4j-backup-2.1.5.jar:2.1.5]
    at org.neo4j.backup.BackupService.doIncrementalBackup(BackupService.java:222) ~[neo4j-backup-2.1.5.jar:2.1.5]
    at org.neo4j.backup.BackupService.doIncrementalBackupOrFallbackToFull(BackupService.java:243) ~[neo4j-backup-2.1.5.jar:2.1.5]
    at org.neo4j.backup.OnlineBackup.backup(OnlineBackup.java:93) ~[neo4j-backup-2.1.5.jar:2.1.5]
    at com.clarifimedia.backup.runner.Neo4jBackupRunner.backup(Neo4jBackupRunner.java:86) ~[land-backup-1.0-SNAPSHOT.jar:na]
    at com.clarifimedia.backup.runner.Neo4jBackupRunner$1.run(Neo4jBackupRunner.java:67) ~[land-backup-1.0-SNAPSHOT.jar:na]
    at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:53) ~[spring-context-3.2.8.RELEASE.jar:3.2.8.RELEASE]
    at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81) [spring-context-3.2.8.RELEASE.jar:3.2.8.RELEASE]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_65]
    at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_65]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178) [na:1.7.0_65]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292) [na:1.7.0_65]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_65]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_65]
    at java.lang.Thread.run(Thread.java:745) [na:1.7.0_65]

数据库将在每个备份之间进行大量写入,并且可能在备份时保持静默。我知道我可以使用backup(backupTarget, false)变体来推测避免这个问题,但我会担心备份的质量。我也可以总是强制进行完整备份,但这似乎是一种大锤方法,可能无法随着数据库的增长而扩展。

可能的切线,当使用以前版本的Neo时(仅偶尔,奇怪)在完全备份和增量备份上看到此警告(节点始终是空间bbox,并且报告了7个错误,而不是2个):

2014-11-25 18:00:07.457+0000 INFO  [org.neo4j]: ERROR: The property chain contains multiple properties that have the same property key id, which means that the entity has at least one duplicate property.
    Node[5,used=true,group=14,prop=42,labels=Inline(0x0:[]),light]

所以问题是,如何执行我可以信任的备份?

编辑 - 2.1.6

它运行完整和几个增量备份(每隔15分钟运行一次),但是一旦对数据库进行任何写入,备份就开始失败:

org.neo4j.consistency.ConsistencyCheckingError: Inconsistencies in transaction:
    Start[3,xid=GlobalId[NEOKERNL|-7692684822052087636|1385|-1], BranchId[ 52 49 52 49 52 49 ],master=-1,me=-1,time=2014-11-27 01:00:04.487+0000/1417050004487,lastCommittedTxWhenTransactionStarted=28847]
    1PC[3, txId=28848, 2014-11-27 01:00:04.491+0000/1417050004491]
    ConsistencySummaryStatistics{
    Number of errors: 1
    Number of warnings: 0
    Number of inconsistent PROPERTY records: 1

}

我可以删除备份文件夹并运行完整备份而不会出现问题。

1 个答案:

答案 0 :(得分:4)

您能否使用最近发布的2.1.6检查问题是否仍然存在?根据{{​​3}},一些备份相关问题已修复。