mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
leveldb recover error handling
This commit is contained in:
parent
5d3ec22975
commit
ef2b3a0801
|
@ -53,9 +53,11 @@ func (store *LevelDBStore) initialize(dir string) (err error) {
|
||||||
if errors.IsCorrupted(err) {
|
if errors.IsCorrupted(err) {
|
||||||
store.db, err = leveldb.RecoverFile(dir, opts)
|
store.db, err = leveldb.RecoverFile(dir, opts)
|
||||||
}
|
}
|
||||||
|
if err != nil {
|
||||||
glog.Infof("filer store open dir %s: %v", dir, err)
|
glog.Infof("filer store open dir %s: %v", dir, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,8 +38,10 @@ func NewLevelDbNeedleMap(dbFileName string, indexFile *os.File, opts *opt.Option
|
||||||
if errors.IsCorrupted(err) {
|
if errors.IsCorrupted(err) {
|
||||||
m.db, err = leveldb.RecoverFile(dbFileName, opts)
|
m.db, err = leveldb.RecoverFile(dbFileName, opts)
|
||||||
}
|
}
|
||||||
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
}
|
||||||
glog.V(1).Infof("Loading %s...", indexFile.Name())
|
glog.V(1).Infof("Loading %s...", indexFile.Name())
|
||||||
mm, indexLoadError := newNeedleMapMetricFromIndexFile(indexFile)
|
mm, indexLoadError := newNeedleMapMetricFromIndexFile(indexFile)
|
||||||
if indexLoadError != nil {
|
if indexLoadError != nil {
|
||||||
|
|
Loading…
Reference in a new issue