create new volumes on less occupied disk locations (#7349)

* create new volumes on less occupied disk locations

* add unit tests

* address comments

* fixes
This commit is contained in:
Chris Lu
2025-10-20 16:11:29 -07:00
committed by GitHub
parent 3e8cc5a906
commit ffd43218f6
4 changed files with 328 additions and 4 deletions

View File

@@ -386,6 +386,19 @@ func (l *DiskLocation) VolumesLen() int {
return len(l.volumes)
}
func (l *DiskLocation) LocalVolumesLen() int {
l.volumesLock.RLock()
defer l.volumesLock.RUnlock()
count := 0
for _, v := range l.volumes {
if !v.HasRemoteFile() {
count++
}
}
return count
}
func (l *DiskLocation) SetStopping() {
l.volumesLock.Lock()
for _, v := range l.volumes {