From ba42e7a7ae0c86b9e39fecadb2638b1c67687caa Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 7 Sep 2024 02:52:09 +0000 Subject: [PATCH] fix(deps): update patch digest dependencies --- go.mod | 8 +++---- go.sum | 16 +++++++------- .../github.com/longhorn/backupstore/lock.go | 22 +++++++++++++++---- vendor/modules.txt | 8 +++---- 4 files changed, 34 insertions(+), 20 deletions(-) diff --git a/go.mod b/go.mod index 3987feff3..bb749f508 100644 --- a/go.mod +++ b/go.mod @@ -8,11 +8,11 @@ require ( github.com/google/uuid v1.6.0 github.com/gorilla/handlers v1.5.2 github.com/gorilla/mux v1.8.1 - github.com/longhorn/backupstore v0.0.0-20240827054225-fe89e488b75f - github.com/longhorn/go-common-libs v0.0.0-20240821134112-907f57efd48f - github.com/longhorn/go-iscsi-helper v0.0.0-20240811043302-df8de353dd58 + github.com/longhorn/backupstore v0.0.0-20240905092550-326b9844e10b + github.com/longhorn/go-common-libs v0.0.0-20240906072425-66d5f9e6ae4e + github.com/longhorn/go-iscsi-helper v0.0.0-20240906072517-88a14fe36c12 github.com/longhorn/sparse-tools v0.0.0-20240729132735-18b207e459ff - github.com/longhorn/types v0.0.0-20240827042720-af8f10eb57cd + github.com/longhorn/types v0.0.0-20240902072916-1bf23d310acb github.com/moby/moby v26.1.5+incompatible github.com/pkg/errors v0.9.1 github.com/rancher/go-fibmap v0.0.0-20160418233256-5fc9f8c1ed47 diff --git a/go.sum b/go.sum index bdb596968..edc20bea4 100644 --- a/go.sum +++ b/go.sum @@ -79,16 +79,16 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/longhorn/backupstore v0.0.0-20240827054225-fe89e488b75f h1:/Wo/leT2yrMmiDieCGhzqyzXb9FNsWoGeYWNfuf29KA= -github.com/longhorn/backupstore v0.0.0-20240827054225-fe89e488b75f/go.mod h1:N4cqNhSs4VUw9aGbO2OfyiIvJL7/L53hUrNiT73UN+U= -github.com/longhorn/go-common-libs v0.0.0-20240821134112-907f57efd48f h1:hjqUs3WVodkzrWwlUMVsnKAlom3uohoNlhZBGLsRvQY= -github.com/longhorn/go-common-libs v0.0.0-20240821134112-907f57efd48f/go.mod h1:Qv34svr/msf6XoUwnrltNBTwMhQljbHEhb5ZKWiRdxo= -github.com/longhorn/go-iscsi-helper v0.0.0-20240811043302-df8de353dd58 h1:fzLAnCLCecoUnsSYyyo7li5GD17xckyBl/zietxz168= -github.com/longhorn/go-iscsi-helper v0.0.0-20240811043302-df8de353dd58/go.mod h1:TobRDCXmF0Ni+jz6+nLJamw3uVu+gNDZoZre1JczGwc= +github.com/longhorn/backupstore v0.0.0-20240905092550-326b9844e10b h1:S+VuYPFMq235z7A/GaGTlv7P1GaUMBjWFeXE+ihn/CM= +github.com/longhorn/backupstore v0.0.0-20240905092550-326b9844e10b/go.mod h1:N4cqNhSs4VUw9aGbO2OfyiIvJL7/L53hUrNiT73UN+U= +github.com/longhorn/go-common-libs v0.0.0-20240906072425-66d5f9e6ae4e h1:TL2faRfkI7uggJhBJYioZk6WGg0ODLvxWxQX2cJPVfE= +github.com/longhorn/go-common-libs v0.0.0-20240906072425-66d5f9e6ae4e/go.mod h1:T8DVg3NdJ7XDNJey+UI1IRUtZKnHtB75MHWmclF6mUI= +github.com/longhorn/go-iscsi-helper v0.0.0-20240906072517-88a14fe36c12 h1:iTMBmwlGckmUaS7nEu8lLcnspiUY5OezhqsnKhtC/kA= +github.com/longhorn/go-iscsi-helper v0.0.0-20240906072517-88a14fe36c12/go.mod h1:jGKOrV2URkqBsM4ZB57kDFY1KUtZKe7mvGWOb58eYCU= github.com/longhorn/sparse-tools v0.0.0-20240729132735-18b207e459ff h1:gmdQDbnaGJ/zmrK+QJzSys8mH679os6i7vW/pOpRn1U= github.com/longhorn/sparse-tools v0.0.0-20240729132735-18b207e459ff/go.mod h1:iUJCZtOKG/9xv2rfrUAYZntFTzP5dZtvy4Kwe6dMcUc= -github.com/longhorn/types v0.0.0-20240827042720-af8f10eb57cd h1:AwVxaFaxLPmyl++SyigaZZw8u+Ggun7HlcmNgNqyhjs= -github.com/longhorn/types v0.0.0-20240827042720-af8f10eb57cd/go.mod h1:KlJuZB8NfHchWshYxYgV9pPIxBKC04Vq05G2TfgMf7w= +github.com/longhorn/types v0.0.0-20240902072916-1bf23d310acb h1:8CoW5YYn+SC43o5zFR+wscOd3SgF6rQZjrkXOkJfZPM= +github.com/longhorn/types v0.0.0-20240902072916-1bf23d310acb/go.mod h1:KlJuZB8NfHchWshYxYgV9pPIxBKC04Vq05G2TfgMf7w= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= diff --git a/vendor/github.com/longhorn/backupstore/lock.go b/vendor/github.com/longhorn/backupstore/lock.go index ee321b62a..32e7fc049 100644 --- a/vendor/github.com/longhorn/backupstore/lock.go +++ b/vendor/github.com/longhorn/backupstore/lock.go @@ -29,6 +29,12 @@ const BACKUP_LOCK LockType = 1 const RESTORE_LOCK LockType = 1 const DELETION_LOCK LockType = 2 +type Operation string + +const BackupOperationCreateRestore Operation = "create/restore" +const BackupOperationDelete Operation = "delete" +const BackupOperationUndefined Operation = "undefined" + type FileLock struct { Name string Type LockType @@ -80,6 +86,14 @@ func (lock *FileLock) canAcquire() bool { func (lock *FileLock) Lock() error { lock.mutex.Lock() defer lock.mutex.Unlock() + + operation := BackupOperationUndefined + if lock.Type == BACKUP_LOCK || lock.Type == RESTORE_LOCK { + operation = BackupOperationCreateRestore + } else if lock.Type == DELETION_LOCK { + operation = BackupOperationDelete + } + if lock.Acquired { atomic.AddInt32(&lock.count, 1) _ = saveLock(lock) @@ -107,16 +121,16 @@ func (lock *FileLock) Lock() error { if !lock.canAcquire() { file := getLockFilePath(lock.volume, lock.Name) _ = removeLock(lock) - return fmt.Errorf("failed lock %v type %v acquisition", file, lock.Type) + return fmt.Errorf("failed to acquire lock %v when performing backup %v, please try again later.", file, operation) } file := getLockFilePath(lock.volume, lock.Name) - log.Infof("Acquired lock %v type %v on backupstore", file, lock.Type) + log.Infof("Acquired lock %v for backup %v on backupstore", file, operation) lock.Acquired = true atomic.AddInt32(&lock.count, 1) if err := saveLock(lock); err != nil { _ = removeLock(lock) - return errors.Wrapf(err, "failed to store updated lock %v type %v after acquisition", file, lock.Type) + return errors.Wrapf(err, "failed to store updated lock %v when performing backup %v, please try again later", file, operation) } // enable lock refresh @@ -133,7 +147,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.WithError(err).Warnf("Failed to refresh acquired lock %v type %v", file, lock.Type) + log.WithError(err).Warnf("Failed to refresh acquired lock %v when performing backup %v, please try again later", file, operation) } } lock.mutex.Unlock() diff --git a/vendor/modules.txt b/vendor/modules.txt index 55e2caa8d..ce938ab35 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -161,7 +161,7 @@ github.com/kr/pretty # github.com/kr/text v0.2.0 ## explicit github.com/kr/text -# github.com/longhorn/backupstore v0.0.0-20240827054225-fe89e488b75f +# github.com/longhorn/backupstore v0.0.0-20240905092550-326b9844e10b ## explicit; go 1.22.0 github.com/longhorn/backupstore github.com/longhorn/backupstore/azblob @@ -178,7 +178,7 @@ github.com/longhorn/backupstore/systembackup github.com/longhorn/backupstore/types github.com/longhorn/backupstore/util github.com/longhorn/backupstore/vfs -# github.com/longhorn/go-common-libs v0.0.0-20240821134112-907f57efd48f +# github.com/longhorn/go-common-libs v0.0.0-20240906072425-66d5f9e6ae4e ## explicit; go 1.22.0 github.com/longhorn/go-common-libs/backup github.com/longhorn/go-common-libs/exec @@ -190,7 +190,7 @@ github.com/longhorn/go-common-libs/sync github.com/longhorn/go-common-libs/sys github.com/longhorn/go-common-libs/types github.com/longhorn/go-common-libs/utils -# github.com/longhorn/go-iscsi-helper v0.0.0-20240811043302-df8de353dd58 +# github.com/longhorn/go-iscsi-helper v0.0.0-20240906072517-88a14fe36c12 ## explicit; go 1.22.0 github.com/longhorn/go-iscsi-helper/iscsi github.com/longhorn/go-iscsi-helper/iscsidev @@ -205,7 +205,7 @@ github.com/longhorn/sparse-tools/sparse/rest github.com/longhorn/sparse-tools/stats github.com/longhorn/sparse-tools/types github.com/longhorn/sparse-tools/util -# github.com/longhorn/types v0.0.0-20240827042720-af8f10eb57cd +# github.com/longhorn/types v0.0.0-20240902072916-1bf23d310acb ## explicit; go 1.21 github.com/longhorn/types/pkg/generated/enginerpc github.com/longhorn/types/pkg/generated/profilerrpc