Merge branch '15430-fts-operator-removal' into main. Closes #15430
[arvados.git] / services / keepstore / volume.go
index 878f690c9bff7a27f8f82e4516326598008c220c..3f7c9cb79b4b24b71c3c441e49235fd657d77e69 100644 (file)
@@ -401,6 +401,9 @@ func (vm *RRVolumeManager) AllWritable() []*VolumeMount {
 // each volume gets a turn to be first. Used by PutBlock to distribute
 // new data across available volumes.
 func (vm *RRVolumeManager) NextWritable() []*VolumeMount {
+       if len(vm.writables) == 0 {
+               return nil
+       }
        offset := (int(atomic.AddUint32(&vm.counter, 1)) - 1) % len(vm.writables)
        return append(append([]*VolumeMount(nil), vm.writables[offset:]...), vm.writables[:offset]...)
 }