volume: compaction can cause readonly volumes

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

No files matched your search

+1 -1
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)
}