Skip to content

Commit

Permalink
[improve](backup) Only compress the running backup/restore job (apach…
Browse files Browse the repository at this point in the history
…e#43177)

For a completed job, there's no need to save it with compressed
serialization as it has no snapshot or backup meta info, making it small
in size.

This helps maintain compatibility more easily.
  • Loading branch information
w41ter committed Nov 6, 2024
1 parent e49d736 commit 33afa07
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,11 @@ public void write(DataOutput out) throws IOException {
count++;
}

if ((type == JobType.BACKUP && Config.backup_job_compressed_serialization)
|| (type == JobType.RESTORE && Config.restore_job_compressed_serialization)) {
// For a completed job, there's no need to save it with compressed serialization as it has
// no snapshot or backup meta info, making it small in size. This helps maintain compatibility
// more easily.
if (!isDone() && ((type == JobType.BACKUP && Config.backup_job_compressed_serialization)
|| (type == JobType.RESTORE && Config.restore_job_compressed_serialization))) {
Text.writeString(out, COMPRESSED_JOB_ID);
GsonUtils.toJsonCompressed(out, this);
} else {
Expand Down

0 comments on commit 33afa07

Please sign in to comment.