mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-19 05:59:23 +08:00
volume: compaction can cause readonly volumes
address https://github.com/chrislusf/seaweedfs/issues/1233
This commit is contained in:
@@ -257,7 +257,7 @@ func (vl *VolumeLayout) SetVolumeUnavailable(dn *DataNode, vid needle.VolumeId)
|
||||
}
|
||||
return false
|
||||
}
|
||||
func (vl *VolumeLayout) SetVolumeAvailable(dn *DataNode, vid needle.VolumeId) bool {
|
||||
func (vl *VolumeLayout) SetVolumeAvailable(dn *DataNode, vid needle.VolumeId, isReadOnly bool) bool {
|
||||
vl.accessLock.Lock()
|
||||
defer vl.accessLock.Unlock()
|
||||
|
||||
@@ -268,7 +268,7 @@ func (vl *VolumeLayout) SetVolumeAvailable(dn *DataNode, vid needle.VolumeId) bo
|
||||
|
||||
vl.vid2location[vid].Set(dn)
|
||||
|
||||
if vInfo.ReadOnly {
|
||||
if vInfo.ReadOnly || isReadOnly {
|
||||
return false
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user