master allocate volumes if ssd type runs out

This commit is contained in:
Chris Lu
2020-12-13 19:44:57 -08:00
parent ac4d4a65af
commit a9db24cd05
4 changed files with 14 additions and 3 deletions

View File

@@ -112,7 +112,7 @@ func (ms *MasterServer) dirAssignHandler(w http.ResponseWriter, r *http.Request)
}
if !ms.Topo.HasWritableVolume(option) {
if ms.Topo.FreeSpace() <= 0 {
if ms.Topo.AvailableSpaceFor(option) <= 0 {
writeJsonQuiet(w, r, http.StatusNotFound, operation.AssignResult{Error: "No free volumes left!"})
return
}