We've started seeing sporadic "stuck" backups using the Java libs:
// https://mvnrepository.com/artifact/org.neo4j/neo4j-backup
implementation "org.neo4j:neo4j-backup:3.4.9"
Targeting a Neo4j Enterprise 3.4.3 we have this snippet:
@Override
public void performBackup(BackupConfig config) {
Neo4jBackupConfig backupConfig = (Neo4jBackupConfig) config;
OnlineBackup onlineBackup = getInstance(backupConfig);
OnlineBackup result = onlineBackup.backup(createBackupDirectory(backupConfig), Neo4jConstants.VERIFY_BACKUP)
.gatheringForensics(Neo4jConstants.GATHER_FORENSICS)
.withTimeout(Neo4jConstants.TIMEOUT_MS);
if (!Optional.ofNullable(result).isPresent()) {
throw new AssertionError("Backup failed. Please see attached log.");
}
if (!result.isConsistent()) {
throw new AssertionError("Backup is inconsistent. Please see attached log.");
}
}
public static final Boolean VERIFY_BACKUP = Boolean.TRUE;
public static final Boolean GATHER_FORENSICS = Boolean.TRUE;
// 5 minute timeout
public static final Long TIMEOUT_MS = 300000L;
And all we see from stdout logs the consistency check seems to stop w/o any corresponding memory / CPU spikes:
2020-01-18 12:41:42.192+0000 INFO [o.n.c.s.StoreCopyClient] Copying neostore
2020-01-18 12:41:42.192+0000 INFO [o.n.c.s.StoreCopyClient] Copied neostore 8.00 kB
2020-01-18 12:41:42.192+0000 INFO [o.n.c.s.StoreCopyClient] Done, copied 711 files
2020-01-18 12:41:52.332+0000 INFO [o.n.k.i.s.f.RecordFormatSelector] Selected RecordFormat:StandardV3_4[v0.A.9] record format
2020-01-18 12:41:52.332+0000 INFO [o.n.k.i.s.f.RecordFormatSelector] Format not configured. Selected format from the store: RecordFormat:StandardV3_4[v0.A.9]
.................... 10%
.................... 20%
.................... 30%
.................... 40%
.................... 50%
.................... 60%
.................... 70%
.................... 80%
.................... 90%
...................Checking node and relationship counts
.................... 10%
.................... 20%
.................... 30%
.................... 40%
.................... 50%
.................... 60%
.................... 70%
.................... 80%
.................... 90%
.................... 100%