aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-12-21 12:43:52 -0800
committerChris Lu <chris.lu@gmail.com>2020-12-21 12:43:52 -0800
commitf5a19a87be8e8802605d9abef425ac2fdf688cf6 (patch)
treeecfa106a38f227a3ae196a3df783fe5e80bd1f37
parentf30de7f8273e9c67b2f35c427916436b4bc20fbf (diff)
downloadseaweedfs-f5a19a87be8e8802605d9abef425ac2fdf688cf6.tar.xz
seaweedfs-f5a19a87be8e8802605d9abef425ac2fdf688cf6.zip
filer: report error if the path specific store is not found
related https://github.com/chrislusf/seaweedfs/issues/1691
-rw-r--r--weed/filer/configuration.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/weed/filer/configuration.go b/weed/filer/configuration.go
index 5f5dfed25..af9c75962 100644
--- a/weed/filer/configuration.go
+++ b/weed/filer/configuration.go
@@ -59,7 +59,11 @@ func (f *Filer) LoadConfiguration(config *viper.Viper) {
parts := strings.Split(key, ".")
storeName, storeId := parts[0], parts[1]
- store := storeNames[storeName]
+ store, found := storeNames[storeName]
+ if !found {
+ glog.Errorf("path-specific filer store %s.%s is not found", storeName, storeId)
+ os.Exit(-1)
+ }
store = reflect.New(reflect.ValueOf(store).Elem().Type()).Interface().(FilerStore)
if err := store.Initialize(config, key+"."); err != nil {
glog.Fatalf("Failed to initialize store for %s: %+v", key, err)