mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-08-01 17:40:22 +08:00
fix func name HasWriableVolume
This commit is contained in:
parent
92653d2c41
commit
bff7b71389
@ -109,7 +109,7 @@ func (t *Topology) NextVolumeId() storage.VolumeId {
|
|||||||
return next
|
return next
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *Topology) HasWriableVolume(option *VolumeGrowOption) bool {
|
func (t *Topology) HasWriteableVolume(option *VolumeGrowOption) bool {
|
||||||
vl := t.GetVolumeLayout(option.Collection, option.ReplicaPlacement, option.Ttl)
|
vl := t.GetVolumeLayout(option.Collection, option.ReplicaPlacement, option.Ttl)
|
||||||
return vl.GetActiveVolumeCount(option) > 0
|
return vl.GetActiveVolumeCount(option) > 0
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ func (ms *MasterServer) dirAssignHandler(w http.ResponseWriter, r *http.Request)
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if !ms.Topo.HasWriableVolume(option) {
|
if !ms.Topo.HasWriteableVolume(option) {
|
||||||
if ms.Topo.FreeSpace() <= 0 {
|
if ms.Topo.FreeSpace() <= 0 {
|
||||||
w.WriteHeader(http.StatusNotFound)
|
w.WriteHeader(http.StatusNotFound)
|
||||||
writeJsonQuiet(w, r, operation.AssignResult{Error: "No free volumes left!"})
|
writeJsonQuiet(w, r, operation.AssignResult{Error: "No free volumes left!"})
|
||||||
@ -86,7 +86,7 @@ func (ms *MasterServer) dirAssignHandler(w http.ResponseWriter, r *http.Request)
|
|||||||
} else {
|
} else {
|
||||||
ms.vgLock.Lock()
|
ms.vgLock.Lock()
|
||||||
defer ms.vgLock.Unlock()
|
defer ms.vgLock.Unlock()
|
||||||
if !ms.Topo.HasWriableVolume(option) {
|
if !ms.Topo.HasWriteableVolume(option) {
|
||||||
if _, err = ms.vg.AutomaticGrowByType(option, ms.Topo); err != nil {
|
if _, err = ms.vg.AutomaticGrowByType(option, ms.Topo); err != nil {
|
||||||
writeJsonQuiet(w, r, operation.AssignResult{Error: "Cannot grow volume group! " + err.Error()})
|
writeJsonQuiet(w, r, operation.AssignResult{Error: "Cannot grow volume group! " + err.Error()})
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user