show error if backend is mis-configured
Some checks failed
go: build dev binaries / cleanup (push) Has been cancelled
docker: build dev containers / build-dev-containers (push) Has been cancelled
End to End / FUSE Mount (push) Has been cancelled
go: build binary / Build (push) Has been cancelled
Ceph S3 tests / Ceph S3 tests (push) Has been cancelled
go: build dev binaries / build_dev_linux_windows (amd64, linux) (push) Has been cancelled
go: build dev binaries / build_dev_linux_windows (amd64, windows) (push) Has been cancelled
go: build dev binaries / build_dev_darwin (amd64, darwin) (push) Has been cancelled
go: build dev binaries / build_dev_darwin (arm64, darwin) (push) Has been cancelled

related to https://github.com/seaweedfs/seaweedfs/discussions/6472
This commit is contained in:
chrislu 2025-01-23 09:18:54 -08:00
parent 95357df8dd
commit be15fee8e7
2 changed files with 8 additions and 2 deletions

View File

@ -52,7 +52,9 @@ func (v *Volume) load(alsoLoadIndex bool, createDatIfMissing bool, needleMapKind
v.noWriteCanDelete = true
v.noWriteOrDelete = false
glog.V(0).Infof("loading volume %d from remote %v", v.Id, v.volumeInfo)
v.LoadRemoteFile()
if err := v.LoadRemoteFile(); err != nil {
return fmt.Errorf("load remote file %v: %v", v.volumeInfo, err)
}
alreadyHasSuperBlock = true
} else if exists, canRead, canWrite, modifiedTime, fileSize := util.CheckFile(v.FileName(".dat")); exists {
// open dat file

View File

@ -1,6 +1,7 @@
package storage
import (
"fmt"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/pb/volume_server_pb"
"github.com/seaweedfs/seaweedfs/weed/storage/backend"
@ -60,7 +61,10 @@ func (v *Volume) HasRemoteFile() bool {
func (v *Volume) LoadRemoteFile() error {
tierFile := v.volumeInfo.GetFiles()[0]
backendStorage := backend.BackendStorages[tierFile.BackendName()]
backendStorage, found := backend.BackendStorages[tierFile.BackendName()]
if !found {
return fmt.Errorf("backend storage %s not found", tierFile.BackendName())
}
if v.DataBackend != nil {
v.DataBackend.Close()