From 44d00ac42c4613c08026fd1481d6a6ea3e7062cd Mon Sep 17 00:00:00 2001 From: Slach Date: Tue, 9 Jan 2024 19:57:21 +0500 Subject: [PATCH] skip CopyObject execution for keys which have zero size, to allow properly backup S3, GCS over S3 and Azure disks --- ChangeLog.md | 4 ++++ pkg/backup/create.go | 3 +++ pkg/backup/restore.go | 3 +++ 3 files changed, 10 insertions(+) diff --git a/ChangeLog.md b/ChangeLog.md index 05c72655..5a6ecddd 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,7 @@ +# v2.4.16 +BUG FIXES +- skip CopyObject execution for keys which have zero size, to allow properly backup S3, GCS over S3 and Azure disks + # v2.4.16 BUG FIXES - increase `AZBLOB_TIMEOUT` to 4h, instead 15m to allow download long size data parts diff --git a/pkg/backup/create.go b/pkg/backup/create.go index 41dc3341..76c5cbde 100644 --- a/pkg/backup/create.go +++ b/pkg/backup/create.go @@ -657,6 +657,9 @@ func (b *Backuper) uploadObjectDiskParts(ctx context.Context, backupName, backup uploadObjectDiskPartsWorkingGroup.Go(func() error { for _, storageObject := range objPartFileMeta.StorageObjects { + if storageObject.ObjectSize == 0 { + continue + } if objSize, err = b.dst.CopyObject( ctx, srcDiskConnection.GetRemoteBucket(), diff --git a/pkg/backup/restore.go b/pkg/backup/restore.go index ccedbfd2..cdcc7d55 100644 --- a/pkg/backup/restore.go +++ b/pkg/backup/restore.go @@ -873,6 +873,9 @@ func (b *Backuper) downloadObjectDiskParts(ctx context.Context, backupName strin downloadObjectDiskPartsWorkingGroup.Go(func() error { var srcBucket, srcKey string for _, storageObject := range objMeta.StorageObjects { + if storageObject.ObjectSize == 0 { + continue + } if b.cfg.General.RemoteStorage == "s3" && diskType == "s3" { srcBucket = b.cfg.S3.Bucket srcKey = path.Join(b.cfg.S3.ObjectDiskPath, backupName, diskName, storageObject.ObjectRelativePath)