From e74000c792cb265e917c83d498a75287856a6e4d Mon Sep 17 00:00:00 2001 From: Chin-Ya Huang Date: Wed, 31 Jul 2024 12:35:14 +0800 Subject: [PATCH] chore: update vendor longhorn/longhorn-6613 Signed-off-by: Chin-Ya Huang --- go.mod | 4 ++++ go.sum | 8 ++++---- .../longhorn/backupstore/deltablock.go | 18 +++++++++--------- .../pkg/client/proxy_backup.go | 2 +- vendor/modules.txt | 6 ++++-- 5 files changed, 22 insertions(+), 16 deletions(-) diff --git a/go.mod b/go.mod index 2d7afedac9..3bd845ef78 100644 --- a/go.mod +++ b/go.mod @@ -48,6 +48,10 @@ replace ( k8s.io/sample-controller => k8s.io/sample-controller v0.30.3 ) +replace github.com/longhorn/longhorn-instance-manager => github.com/c3y1huang/longhorn-instance-manager v1.7.0-dev.0.20240801044340-3b8ef06e282f + +replace github.com/longhorn/backupstore => github.com/c3y1huang/backupstore v0.0.0-20240801044144-23f54c14bbce + require ( github.com/container-storage-interface/spec v1.9.0 github.com/docker/go-connections v0.5.0 diff --git a/go.sum b/go.sum index 1d73bdf264..8da8f175c8 100644 --- a/go.sum +++ b/go.sum @@ -813,6 +813,10 @@ github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= +github.com/c3y1huang/backupstore v0.0.0-20240801044144-23f54c14bbce h1:h5NOhEdBUJQoUiHNtjP+iyPzlkkJykosQpj7zgDDv3c= +github.com/c3y1huang/backupstore v0.0.0-20240801044144-23f54c14bbce/go.mod h1:7L/qcMq6IK3S/VU52AtmeKCnOK9Tz1XmMilzo2ILEm8= +github.com/c3y1huang/longhorn-instance-manager v1.7.0-dev.0.20240801044340-3b8ef06e282f h1:GWa+/CHRIWjOY8FcXJOES+8vhgZ/MHj9Kd8aMlI2Ibw= +github.com/c3y1huang/longhorn-instance-manager v1.7.0-dev.0.20240801044340-3b8ef06e282f/go.mod h1:ObI4ZY201cy/keWpgQbsgE6RtM4+aUJWHM+XF3+tixA= github.com/c9s/goprocinfo v0.0.0-20210130143923-c95fcf8c64a8 h1:SjZ2GvvOononHOpK84APFuMvxqsk3tEIaKH/z4Rpu3g= github.com/c9s/goprocinfo v0.0.0-20210130143923-c95fcf8c64a8/go.mod h1:uEyr4WpAH4hio6LFriaPkL938XnrvLpNPmQHBdrmbIE= github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= @@ -1222,8 +1226,6 @@ github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhn github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= github.com/longhorn/backing-image-manager v1.7.0-rc1 h1:kD106yhLtofxDwXkvKs77VAFzTVdJnbxsD2m28X4tp0= github.com/longhorn/backing-image-manager v1.7.0-rc1/go.mod h1:ZXD/+yKwMer/eZzwQ2ev/eAyLvih7WNq6NDgfUpvQ+8= -github.com/longhorn/backupstore v0.0.0-20240720163059-56c90cd23634 h1:gfrFl0YwZSfyiaLdg7TFKSHtBgMJclDGDtBjUhGe0ik= -github.com/longhorn/backupstore v0.0.0-20240720163059-56c90cd23634/go.mod h1:7L/qcMq6IK3S/VU52AtmeKCnOK9Tz1XmMilzo2ILEm8= github.com/longhorn/go-common-libs v0.0.0-20240727052403-b543ea3732fe h1:EiCGiOecnzl4dp0nDesT6UD6wA7T44VnUiXxYYdVBG0= github.com/longhorn/go-common-libs v0.0.0-20240727052403-b543ea3732fe/go.mod h1:n8qac+ubzVdubf0kuMzsjKZxn43IuhLAHeakwpnB7UM= github.com/longhorn/go-iscsi-helper v0.0.0-20240727052644-d2442a50e906 h1:1FoEoyIQRtKAKv3O8MJ1nczly3+WMzbFbjT3pmakpWw= @@ -1232,8 +1234,6 @@ github.com/longhorn/go-spdk-helper v0.0.0-20240727080828-a55a2982815a h1:x54NTKw github.com/longhorn/go-spdk-helper v0.0.0-20240727080828-a55a2982815a/go.mod h1:sD6aVynQSbPnYyJ77NLiYbWNI5zyzxcVzIEnXFcKCww= github.com/longhorn/longhorn-engine v1.7.0-rc1 h1:kQ4BwCvBemWsQvVnLdRsbiCXR3zmQBMA1J9Ezysh2q0= github.com/longhorn/longhorn-engine v1.7.0-rc1/go.mod h1:u0TZ1221YusDYA+ExdVLjLid1Ps6JuJXgh9185l5D9Y= -github.com/longhorn/longhorn-instance-manager v1.7.0-dev.0.20240731053924-6cc08179c5cb h1:A98gAFy2sR5Nf2KZ4+sVsNRvFUBidK8TpyJ+mDUi5AQ= -github.com/longhorn/longhorn-instance-manager v1.7.0-dev.0.20240731053924-6cc08179c5cb/go.mod h1:g0R2rLXvf0Mi6rHq8eNA/ESE7Ykm9+EUNSbPxoz9GmA= github.com/longhorn/longhorn-share-manager v1.7.0-rc1 h1:LsSkSajhG8tCfORKKfwK+8XHVrT/8rI9DRWb7fuoVls= github.com/longhorn/longhorn-share-manager v1.7.0-rc1/go.mod h1:R6+NscPU4lAV5ueO7//lBCAO3en0aDbZi5KkkOSUJvk= github.com/longhorn/types v0.0.0-20240725040629-473d671316c4 h1:L2g0sIJ2fXt4BSFRYNnF6ObtKryCUFm9qLcCXHWssCk= diff --git a/vendor/github.com/longhorn/backupstore/deltablock.go b/vendor/github.com/longhorn/backupstore/deltablock.go index 16c5ad42cc..7cc480326f 100644 --- a/vendor/github.com/longhorn/backupstore/deltablock.go +++ b/vendor/github.com/longhorn/backupstore/deltablock.go @@ -110,7 +110,7 @@ type DeltaBlockBackupOperations interface { } type DeltaRestoreOperations interface { - OpenVolumeDev(volDevName string) (*os.File, string, error) + OpenVolumeDev(volDevName string, dmDeviceAndEndpointCleanupRequired bool) (*os.File, string, error) CloseVolumeDev(volDev *os.File) error UpdateRestoreStatus(snapshot string, restoreProgress int, err error) Stop() @@ -735,7 +735,7 @@ func RestoreDeltaBlockBackup(ctx context.Context, config *DeltaRestoreConfig) er return fmt.Errorf("invalid volume size %v", vol.Size) } - volDev, volDevPath, err := deltaOps.OpenVolumeDev(volDevName) + volDev, volDevPath, err := deltaOps.OpenVolumeDev(volDevName, false) if err != nil { return errors.Wrapf(err, "failed to open volume device %v", volDevName) } @@ -894,14 +894,14 @@ func RestoreDeltaBlockBackupIncrementally(ctx context.Context, config *DeltaRest } } - volDev, err := os.Create(volDevName) + volDev, volDevPath, err := deltaOps.OpenVolumeDev(volDevName, true) if err != nil { - return err + return errors.Wrapf(err, "failed to open volume device %v", volDevName) } defer func() { // make sure to close the device if err != nil { - _ = volDev.Close() + _ = deltaOps.CloseVolumeDev(volDev) } }() @@ -933,8 +933,8 @@ func RestoreDeltaBlockBackupIncrementally(ctx context.Context, config *DeltaRest return err } go func() { - defer volDev.Close() defer func() { + _ = deltaOps.CloseVolumeDev(volDev) if unlockErr := lock.Unlock(); unlockErr != nil { logrus.WithError(err).Warn("Failed to unlock") } @@ -953,7 +953,7 @@ func RestoreDeltaBlockBackupIncrementally(ctx context.Context, config *DeltaRest } } - if err := performIncrementalRestore(ctx, bsDriver, config, srcVolumeName, volDevName, lastBackup, backup); err != nil { + if err := performIncrementalRestore(ctx, bsDriver, config, srcVolumeName, volDevPath, lastBackup, backup); err != nil { deltaOps.UpdateRestoreStatus(volDevName, 0, err) return } @@ -1107,7 +1107,7 @@ func restoreBlocks(ctx context.Context, bsDriver BackupStoreDriver, deltaOps Del } func performIncrementalRestore(ctx context.Context, bsDriver BackupStoreDriver, config *DeltaRestoreConfig, - srcVolumeName, volDevName string, lastBackup *Backup, backup *Backup) error { + srcVolumeName, volDevPath string, lastBackup *Backup, backup *Backup) error { var err error concurrentLimit := config.ConcurrentLimit @@ -1119,7 +1119,7 @@ func performIncrementalRestore(ctx context.Context, bsDriver BackupStoreDriver, errorChans := []<-chan error{errChan} for i := 0; i < int(concurrentLimit); i++ { - errorChans = append(errorChans, restoreBlocks(ctx, bsDriver, config.DeltaOps, config.Filename, srcVolumeName, blockChan, progress)) + errorChans = append(errorChans, restoreBlocks(ctx, bsDriver, config.DeltaOps, volDevPath, srcVolumeName, blockChan, progress)) } mergedErrChan := mergeErrorChannels(ctx, errorChans...) diff --git a/vendor/github.com/longhorn/longhorn-instance-manager/pkg/client/proxy_backup.go b/vendor/github.com/longhorn/longhorn-instance-manager/pkg/client/proxy_backup.go index 2bb97e53f3..e566faba7e 100644 --- a/vendor/github.com/longhorn/longhorn-instance-manager/pkg/client/proxy_backup.go +++ b/vendor/github.com/longhorn/longhorn-instance-manager/pkg/client/proxy_backup.go @@ -179,7 +179,7 @@ func (c *ProxyClient) BackupRestore(dataEngine, engineName, volumeName, serviceA return err } - return nil + return c.BackupRestoreFinish(dataEngine, engineName, volumeName, serviceAddress) } func (c *ProxyClient) BackupRestoreFinish(dataEngine, engineName, volumeName, serviceAddress string) error { diff --git a/vendor/modules.txt b/vendor/modules.txt index 2ab2324d8c..b3846cac8c 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -230,7 +230,7 @@ github.com/longhorn/backing-image-manager/pkg/client github.com/longhorn/backing-image-manager/pkg/meta github.com/longhorn/backing-image-manager/pkg/types github.com/longhorn/backing-image-manager/pkg/util -# github.com/longhorn/backupstore v0.0.0-20240720163059-56c90cd23634 +# github.com/longhorn/backupstore v0.0.0-20240720163059-56c90cd23634 => github.com/c3y1huang/backupstore v0.0.0-20240801044144-23f54c14bbce ## explicit; go 1.22.0 github.com/longhorn/backupstore github.com/longhorn/backupstore/backupbackingimage @@ -269,7 +269,7 @@ github.com/longhorn/longhorn-engine/pkg/meta github.com/longhorn/longhorn-engine/pkg/replica/client github.com/longhorn/longhorn-engine/pkg/types github.com/longhorn/longhorn-engine/pkg/util -# github.com/longhorn/longhorn-instance-manager v1.7.0-dev.0.20240731053924-6cc08179c5cb +# github.com/longhorn/longhorn-instance-manager v1.7.0-dev.0.20240731053924-6cc08179c5cb => github.com/c3y1huang/longhorn-instance-manager v1.7.0-dev.0.20240801044340-3b8ef06e282f ## explicit; go 1.22.2 github.com/longhorn/longhorn-instance-manager/pkg/api github.com/longhorn/longhorn-instance-manager/pkg/client @@ -1594,3 +1594,5 @@ sigs.k8s.io/yaml # k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.30.3 # k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.30.3 # k8s.io/sample-controller => k8s.io/sample-controller v0.30.3 +# github.com/longhorn/longhorn-instance-manager => github.com/c3y1huang/longhorn-instance-manager v1.7.0-dev.0.20240801044340-3b8ef06e282f +# github.com/longhorn/backupstore => github.com/c3y1huang/backupstore v0.0.0-20240801044144-23f54c14bbce