volume: compaction can cause readonly volumes

address https://github.com/chrislusf/seaweedfs/issues/1233
This commit is contained in:
Chris Lu
2020-03-17 09:43:57 -07:00
parent 12df236def
commit c3cb6fa1d7
9 changed files with 239 additions and 215 deletions

View File

@@ -94,7 +94,7 @@ func (v *Volume) load(alsoLoadIndex bool, createDatIfMissing bool, needleMapKind
glog.V(0).Infof("volumeDataIntegrityChecking failed %v", err)
}
if v.noWriteOrDelete || v.noWriteCanDelete {
if v.IsReadOnly() {
if v.nm, err = NewSortedFileNeedleMap(fileName, indexFile); err != nil {
glog.V(0).Infof("loading sorted db %s error: %v", fileName+".sdx", err)
}