mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
volume server: add a fix for dead lock
https://github.com/chrislusf/seaweedfs/issues/1353
This commit is contained in:
parent
b8e346cc86
commit
bdbe5ddbe9
|
@ -76,7 +76,7 @@ func (v *Volume) syncWrite(n *needle.Needle) (offset uint64, size uint32, isUnch
|
||||||
defer v.dataFileAccessLock.Unlock()
|
defer v.dataFileAccessLock.Unlock()
|
||||||
|
|
||||||
if MaxPossibleVolumeSize < v.nm.ContentSize()+uint64(actualSize) {
|
if MaxPossibleVolumeSize < v.nm.ContentSize()+uint64(actualSize) {
|
||||||
err = fmt.Errorf("volume size limit %d exceeded! current size is %d", MaxPossibleVolumeSize, v.ContentSize())
|
err = fmt.Errorf("volume size limit %d exceeded! current size is %d", MaxPossibleVolumeSize, v.nm.ContentSize())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if v.isFileUnchanged(n) {
|
if v.isFileUnchanged(n) {
|
||||||
|
@ -190,7 +190,7 @@ func (v *Volume) syncDelete(n *needle.Needle) (uint32, error) {
|
||||||
defer v.dataFileAccessLock.Unlock()
|
defer v.dataFileAccessLock.Unlock()
|
||||||
|
|
||||||
if MaxPossibleVolumeSize < v.nm.ContentSize()+uint64(actualSize) {
|
if MaxPossibleVolumeSize < v.nm.ContentSize()+uint64(actualSize) {
|
||||||
err := fmt.Errorf("volume size limit %d exceeded! current size is %d", MaxPossibleVolumeSize, v.ContentSize())
|
err := fmt.Errorf("volume size limit %d exceeded! current size is %d", MaxPossibleVolumeSize, v.nm.ContentSize())
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue