Skip to content

Commit

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

cherry pick from #43278
  • Loading branch information
w41ter authored Nov 8, 2024
1 parent 69eb02b commit 80de533
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1066,11 +1066,15 @@ public static BackupJob read(DataInput in) throws IOException {

@Override
public void write(DataOutput out) throws IOException {
if (Config.backup_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.
boolean shouldCompress = !isDone() && Config.backup_job_compressed_serialization;
if (shouldCompress) {
type = JobType.BACKUP_COMPRESSED;
}
super.write(out);
if (Config.backup_job_compressed_serialization) {
if (shouldCompress) {
type = JobType.BACKUP;

int written = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2498,11 +2498,15 @@ public static RestoreJob read(DataInput in) throws IOException {

@Override
public void write(DataOutput out) throws IOException {
if (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.
boolean shouldCompress = !isDone() && Config.restore_job_compressed_serialization;
if (shouldCompress) {
type = JobType.RESTORE_COMPRESSED;
}
super.write(out);
if (Config.restore_job_compressed_serialization) {
if (shouldCompress) {
type = JobType.RESTORE;

int written = 0;
Expand Down

0 comments on commit 80de533

Please sign in to comment.