diff --git a/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OAbstractPaginatedStorage.java b/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OAbstractPaginatedStorage.java index 250fa845745..01eb31645cd 100755 --- a/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OAbstractPaginatedStorage.java +++ b/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OAbstractPaginatedStorage.java @@ -5907,7 +5907,7 @@ public boolean supportIncremental() { public void fullIncrementalBackup(final OutputStream stream) throws UnsupportedOperationException { try { - incrementalBackup(stream, null, false); + incrementalBackup(stream, null, false, false); } catch (IOException e) { throw OException.wrapException(new OStorageException("Error during incremental backup"), e); } @@ -5916,6 +5916,15 @@ public void fullIncrementalBackup(final OutputStream stream) protected OLogSequenceNumber incrementalBackup( final OutputStream stream, final OLogSequenceNumber fromLsn, final boolean singleThread) throws IOException { + return incrementalBackup(stream, fromLsn, singleThread, true); + } + + protected OLogSequenceNumber incrementalBackup( + final OutputStream stream, + final OLogSequenceNumber fromLsn, + final boolean singleThread, + boolean writeMetadata) + throws IOException { OLogSequenceNumber lastLsn; checkOpennessAndMigration(); @@ -6028,7 +6037,9 @@ protected OLogSequenceNumber incrementalBackup( } } finally { try { - zipOutputStream.finish(); + if (writeMetadata) { + zipOutputStream.finish(); + } zipOutputStream.flush(); } catch (IOException e) { OLogManager.instance().warn(this, "Failed to flush resource " + zipOutputStream);