diff --git a/pkg/local_object_storage/metabase/control.go b/pkg/local_object_storage/metabase/control.go index 42f60d2c4..e689824fd 100644 --- a/pkg/local_object_storage/metabase/control.go +++ b/pkg/local_object_storage/metabase/control.go @@ -114,5 +114,9 @@ func (db *DB) init(reset bool) error { // Close closes boltDB instance. func (db *DB) Close() error { - return db.boltDB.Close() + if db.boltDB != nil { + return db.boltDB.Close() + } + + return nil } diff --git a/pkg/local_object_storage/shard/control.go b/pkg/local_object_storage/shard/control.go index 930e5e8e2..f1b44c7e3 100644 --- a/pkg/local_object_storage/shard/control.go +++ b/pkg/local_object_storage/shard/control.go @@ -204,11 +204,7 @@ func (s *Shard) Close() error { components = append(components, s.writeCache) } - components = append(components, s.pilorama, s.blobStor) - - if s.GetMode() != ModeDegraded { - components = append(components, s.metaBase) - } + components = append(components, s.pilorama, s.blobStor, s.metaBase) for _, component := range components { if err := component.Close(); err != nil {