diff --git a/go.mod b/go.mod index 6cc07b7dcd..5169b7ec8d 100644 --- a/go.mod +++ b/go.mod @@ -45,12 +45,12 @@ require ( github.com/jinzhu/copier v0.3.5 github.com/kubernetes-csi/csi-lib-utils v0.6.1 github.com/longhorn/backing-image-manager v1.4.0-rc1.0.20230521151917-38ff27cc2cbb - github.com/longhorn/backupstore v0.0.0-20230620040003-393d5122a38c + github.com/longhorn/backupstore v0.0.0-20230627040634-5b4f2d040e9d github.com/longhorn/go-iscsi-helper v0.0.0-20230529082528-4c3270590712 github.com/longhorn/go-spdk-helper v0.0.0-20230626041832-c611b61f6b36 - github.com/longhorn/longhorn-engine v1.5.0-rc2.0.20230626084001-d82e290abcc9 - github.com/longhorn/longhorn-instance-manager v1.5.0-rc2.0.20230626085618-b35c18699f21 - github.com/longhorn/longhorn-share-manager v1.5.0-rc2 + github.com/longhorn/longhorn-engine v1.5.0-rc3.0.20230628003600-018cd51ec7bd + github.com/longhorn/longhorn-instance-manager v1.5.0-rc3.0.20230628024133-a0a70bd7503a + github.com/longhorn/longhorn-share-manager v1.5.0-rc3 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.15.0 github.com/rancher/dynamiclistener v0.3.1 @@ -131,7 +131,7 @@ require ( github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect - github.com/longhorn/longhorn-spdk-engine v0.0.0-20230626073013-4d74edb3633a // indirect + github.com/longhorn/longhorn-spdk-engine v0.0.0-20230627161406-64cb30ad3cf1 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect diff --git a/go.sum b/go.sum index a1d5253048..c73eb4a040 100644 --- a/go.sum +++ b/go.sum @@ -499,20 +499,20 @@ github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9 github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z9BP0jIOc= github.com/longhorn/backing-image-manager v1.4.0-rc1.0.20230521151917-38ff27cc2cbb h1:y59M4Z8jvOowAwdXcATyHjG31ZbaMJvjIPY+SpVmeII= github.com/longhorn/backing-image-manager v1.4.0-rc1.0.20230521151917-38ff27cc2cbb/go.mod h1:yhfIPKYbnFpRmrJOz0biNthyoyBpN4SrUk8ZQNMcW1o= -github.com/longhorn/backupstore v0.0.0-20230620040003-393d5122a38c h1:uul+kPFHTHQ+acFmIUAl7f3fiuhTN19mUGZuyOFMvXs= -github.com/longhorn/backupstore v0.0.0-20230620040003-393d5122a38c/go.mod h1:wiEYTbvxEAIUxAAY1DmvMeuFuGqwWmJTzfVhZiBKlNo= +github.com/longhorn/backupstore v0.0.0-20230627040634-5b4f2d040e9d h1:sJBr2HsVp61Lpb4zj4dDGLr4RuTQtJwogw/mPe1DBkI= +github.com/longhorn/backupstore v0.0.0-20230627040634-5b4f2d040e9d/go.mod h1:wiEYTbvxEAIUxAAY1DmvMeuFuGqwWmJTzfVhZiBKlNo= github.com/longhorn/go-iscsi-helper v0.0.0-20230529082528-4c3270590712 h1:IOBWtvr2ZdpQs3Fy8ecre3vZOBvmLJXme9qB6sqWdlw= github.com/longhorn/go-iscsi-helper v0.0.0-20230529082528-4c3270590712/go.mod h1:hxy8Ra38KtX4MFmXZRAZUpJZSYcaI1pmnWmKA3ICA2c= github.com/longhorn/go-spdk-helper v0.0.0-20230626041832-c611b61f6b36 h1:wUaSMEhkoB+ZFH1Bru5wgxrFruE4NDkl5bXXDVciqQY= github.com/longhorn/go-spdk-helper v0.0.0-20230626041832-c611b61f6b36/go.mod h1:XoGXOYHw1KW3qdvTSimwY+Anyg5cPl6EVkjXxS25Upg= -github.com/longhorn/longhorn-engine v1.5.0-rc2.0.20230626084001-d82e290abcc9 h1:ck5FqZdAW7irhFY09G/ZGq8eU+6DBkw0VTnogMe1rbs= -github.com/longhorn/longhorn-engine v1.5.0-rc2.0.20230626084001-d82e290abcc9/go.mod h1:g/dipfdkEwgu1WczQ7NIR2pncYOUacExQgFwwFMUvps= -github.com/longhorn/longhorn-instance-manager v1.5.0-rc2.0.20230626085618-b35c18699f21 h1:p4nSk95r1mn0Ikln5YLgK9IJAKKQbqw2ZNV99pvgmEY= -github.com/longhorn/longhorn-instance-manager v1.5.0-rc2.0.20230626085618-b35c18699f21/go.mod h1:iGBXSI9+kdDuX7ZQYmT7fia6xHFVCxn9bqopmMtZFe4= -github.com/longhorn/longhorn-share-manager v1.5.0-rc2 h1:kzyxv4xEDB/z7L6YjJTGl2R88goPKT8GNeimgMaZ5sw= -github.com/longhorn/longhorn-share-manager v1.5.0-rc2/go.mod h1:Kq3D8tu8J1SED7XiVM6Yco6qkizxCjVhYzR78bqhUUI= -github.com/longhorn/longhorn-spdk-engine v0.0.0-20230626073013-4d74edb3633a h1:tz229Pfu/jcTXOfih/sryPPyvD83Lbc7hxJzCMWkbPI= -github.com/longhorn/longhorn-spdk-engine v0.0.0-20230626073013-4d74edb3633a/go.mod h1:yZawDOljQHgh+ZzPCIL+xr5VXzK85bps8J42HJXHnyg= +github.com/longhorn/longhorn-engine v1.5.0-rc3.0.20230628003600-018cd51ec7bd h1:YX0i1Ig+2bTt/3fNe6ylHIu8st8e+aGKZ0RaovoR8jc= +github.com/longhorn/longhorn-engine v1.5.0-rc3.0.20230628003600-018cd51ec7bd/go.mod h1:OOjKIyGpTxmZFWkn8N1G+H4pga0niuMgzrR/h5HUJNo= +github.com/longhorn/longhorn-instance-manager v1.5.0-rc3.0.20230628024133-a0a70bd7503a h1:PC809jVPQ9TQUrz8DUbQaiCMxh5OmRw2uyT1tNCA3t8= +github.com/longhorn/longhorn-instance-manager v1.5.0-rc3.0.20230628024133-a0a70bd7503a/go.mod h1:mmoKCu2SGWyNYqZlEOq2/I7JgdYYhIE91wb30IiIEbU= +github.com/longhorn/longhorn-share-manager v1.5.0-rc3 h1:5AEayODCF+cLlRO/a0fjCivs/5TxbX7MCK08S1V9L4g= +github.com/longhorn/longhorn-share-manager v1.5.0-rc3/go.mod h1:Kq3D8tu8J1SED7XiVM6Yco6qkizxCjVhYzR78bqhUUI= +github.com/longhorn/longhorn-spdk-engine v0.0.0-20230627161406-64cb30ad3cf1 h1:xygJgcpxNqOAI1B7ri33RsTSMHr6QPod1TVuQQqHe/4= +github.com/longhorn/longhorn-spdk-engine v0.0.0-20230627161406-64cb30ad3cf1/go.mod h1:yZawDOljQHgh+ZzPCIL+xr5VXzK85bps8J42HJXHnyg= github.com/longhorn/nsfilelock v0.0.0-20200723175406-fa7c83ad0003/go.mod h1:0CLeXlf59Lg6C0kjLSDf47ft73Dh37CwymYRKWwAn04= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= diff --git a/vendor/github.com/longhorn/backupstore/config.go b/vendor/github.com/longhorn/backupstore/config.go index a840e441e3..e37752d7b7 100644 --- a/vendor/github.com/longhorn/backupstore/config.go +++ b/vendor/github.com/longhorn/backupstore/config.go @@ -51,16 +51,18 @@ func LoadConfigInBackupStore(driver BackupStoreDriver, filePath string, v interf LogFieldObject: LogObjectConfig, LogFieldKind: driver.Kind(), LogFieldFilepath: filePath, - }).Debug() + }).Info("Loading config in backupstore") + if err := json.NewDecoder(rc).Decode(v); err != nil { return err } + log.WithFields(logrus.Fields{ LogFieldReason: LogReasonComplete, LogFieldObject: LogObjectConfig, LogFieldKind: driver.Kind(), LogFieldFilepath: filePath, - }).Debug() + }).Info("Loaded config in backupstore") return nil } @@ -74,16 +76,18 @@ func SaveConfigInBackupStore(driver BackupStoreDriver, filePath string, v interf LogFieldObject: LogObjectConfig, LogFieldKind: driver.Kind(), LogFieldFilepath: filePath, - }).Debug() + }).Info("Saving config in backupstore") + if err := driver.Write(filePath, bytes.NewReader(j)); err != nil { return err } + log.WithFields(logrus.Fields{ LogFieldReason: LogReasonComplete, LogFieldObject: LogObjectConfig, LogFieldKind: driver.Kind(), LogFieldFilepath: filePath, - }).Debug() + }).Info("Saved config in backupstore") return nil } @@ -249,7 +253,7 @@ func loadVolume(driver BackupStoreDriver, volumeName string) (*Volume, error) { } // Backward compatibility if v.CompressionMethod == "" { - log.Infof("Fall back compression method to %v for volume %v", LEGACY_COMPRESSION_METHOD, v.Name) + log.Infof("Falling back compression method to %v for volume %v", LEGACY_COMPRESSION_METHOD, v.Name) v.CompressionMethod = LEGACY_COMPRESSION_METHOD } return v, nil diff --git a/vendor/github.com/longhorn/backupstore/deltablock.go b/vendor/github.com/longhorn/backupstore/deltablock.go index 5267135086..07ffcb34c4 100644 --- a/vendor/github.com/longhorn/backupstore/deltablock.go +++ b/vendor/github.com/longhorn/backupstore/deltablock.go @@ -118,8 +118,15 @@ func CreateDeltaBlockBackup(backupName string, config *DeltaBackupConfig) (isInc return false, fmt.Errorf("BUG: missing DeltaBlockBackupOperations") } + log := logrus.WithFields(logrus.Fields{ + "volume": volume, + "snapshot": snapshot, + "destURL": destURL, + }) + defer func() { if err != nil { + log.WithError(err).Error("Failed to create delta block backup") deltaOps.UpdateBackupStatus(snapshot.Name, volume.Name, string(ProgressStateError), 0, "", err.Error()) } }() @@ -176,7 +183,7 @@ func CreateDeltaBlockBackup(backupName string, config *DeltaBackupConfig) (isInc LogFieldObject: LogObjectSnapshot, LogFieldSnapshot: backup.SnapshotName, LogFieldVolume: volume.Name, - }).Info("Create full snapshot config") + }).Info("Creating full snapshot config") } else if backup.SnapshotName != "" && !deltaOps.HasSnapshot(backup.SnapshotName, volume.Name) { log.WithFields(logrus.Fields{ LogFieldReason: LogReasonFallback, @@ -244,6 +251,7 @@ func CreateDeltaBlockBackup(backupName string, config *DeltaBackupConfig) (isInc deltaOps.UpdateBackupStatus(snapshot.Name, volume.Name, string(ProgressStateInProgress), 0, "", "") + log.Info("Performing delta block backup") if progress, backup, err := performBackup(bsDriver, config, delta, deltaBackup, backupRequest.lastBackup); err != nil { logrus.WithError(err).Errorf("Failed to perform backup for volume %v snapshot %v", volume.Name, snapshot.Name) deltaOps.UpdateBackupStatus(snapshot.Name, volume.Name, string(ProgressStateInProgress), progress, "", err.Error()) @@ -708,7 +716,7 @@ func RestoreDeltaBlockBackup(config *DeltaRestoreConfig) error { LogFieldOrigVolume: srcVolumeName, LogFieldVolumeDev: volDevName, LogEventBackupURL: backupURL, - }).Debug() + }).Info("Restoring delta block backup") // keep lock alive for async go routine. if err := lock.Lock(); err != nil { diff --git a/vendor/github.com/longhorn/backupstore/lock.go b/vendor/github.com/longhorn/backupstore/lock.go index 83dca9489c..ee321b62a5 100644 --- a/vendor/github.com/longhorn/backupstore/lock.go +++ b/vendor/github.com/longhorn/backupstore/lock.go @@ -133,7 +133,7 @@ func (lock *FileLock) Lock() error { if lock.Acquired { if err := saveLock(lock); err != nil { // nothing we can do here, that's why the lock acquisition time is 2x lock refresh interval - log.Infof("Failed to refresh acquired lock %v type %v", file, lock.Type) + log.WithError(err).Warnf("Failed to refresh acquired lock %v type %v", file, lock.Type) } } lock.mutex.Unlock() diff --git a/vendor/modules.txt b/vendor/modules.txt index bc287f3bba..f9871b9a7a 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -219,7 +219,7 @@ github.com/longhorn/backing-image-manager/pkg/meta github.com/longhorn/backing-image-manager/pkg/rpc github.com/longhorn/backing-image-manager/pkg/types github.com/longhorn/backing-image-manager/pkg/util -# github.com/longhorn/backupstore v0.0.0-20230620040003-393d5122a38c +# github.com/longhorn/backupstore v0.0.0-20230627040634-5b4f2d040e9d ## explicit; go 1.17 github.com/longhorn/backupstore github.com/longhorn/backupstore/logging @@ -233,14 +233,14 @@ github.com/longhorn/go-iscsi-helper/util # github.com/longhorn/go-spdk-helper v0.0.0-20230626041832-c611b61f6b36 ## explicit; go 1.17 github.com/longhorn/go-spdk-helper/pkg/types -# github.com/longhorn/longhorn-engine v1.5.0-rc2.0.20230626084001-d82e290abcc9 +# github.com/longhorn/longhorn-engine v1.5.0-rc3.0.20230628003600-018cd51ec7bd ## explicit; go 1.20 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-engine/proto/ptypes -# github.com/longhorn/longhorn-instance-manager v1.5.0-rc2.0.20230626085618-b35c18699f21 +# github.com/longhorn/longhorn-instance-manager v1.5.0-rc3.0.20230628024133-a0a70bd7503a ## explicit; go 1.20 github.com/longhorn/longhorn-instance-manager/pkg/api github.com/longhorn/longhorn-instance-manager/pkg/client @@ -248,7 +248,7 @@ github.com/longhorn/longhorn-instance-manager/pkg/imrpc github.com/longhorn/longhorn-instance-manager/pkg/meta github.com/longhorn/longhorn-instance-manager/pkg/types github.com/longhorn/longhorn-instance-manager/pkg/util -# github.com/longhorn/longhorn-share-manager v1.5.0-rc2 +# github.com/longhorn/longhorn-share-manager v1.5.0-rc3 ## explicit; go 1.20 github.com/longhorn/longhorn-share-manager/pkg/client github.com/longhorn/longhorn-share-manager/pkg/crypto @@ -258,7 +258,7 @@ github.com/longhorn/longhorn-share-manager/pkg/server/nfs github.com/longhorn/longhorn-share-manager/pkg/types github.com/longhorn/longhorn-share-manager/pkg/util github.com/longhorn/longhorn-share-manager/pkg/volume -# github.com/longhorn/longhorn-spdk-engine v0.0.0-20230626073013-4d74edb3633a +# github.com/longhorn/longhorn-spdk-engine v0.0.0-20230627161406-64cb30ad3cf1 ## explicit; go 1.17 github.com/longhorn/longhorn-spdk-engine/pkg/types github.com/longhorn/longhorn-spdk-engine/proto/spdkrpc