Skip to content

Commit

Permalink
fix: avoid to flush metadatas on between node sync
Browse files Browse the repository at this point in the history
  • Loading branch information
tglman committed Feb 23, 2024
1 parent a86350d commit 1060afd
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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();
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 1060afd

Please sign in to comment.