Master: volume assignment concurrency (#7159)

* volume assginment concurrency

* accurate tests

* ensure uniqness

* reserve atomically

* address comments

* atomic

* ReserveOneVolumeForReservation

* duplicated

* Update weed/topology/node.go

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Update weed/topology/node.go

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* atomic counter

* dedup

* select the appropriate functions based on the useReservations flag

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
Chris Lu
2025-08-23 21:02:30 -07:00
committed by GitHub
parent 91b88262d7
commit 7acebf11ea
10 changed files with 1086 additions and 32 deletions

View File

@@ -1,9 +1,10 @@
package topology
import (
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
"slices"
"strings"
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
)
type DataCenter struct {
@@ -16,6 +17,7 @@ func NewDataCenter(id string) *DataCenter {
dc.nodeType = "DataCenter"
dc.diskUsages = newDiskUsages()
dc.children = make(map[NodeId]Node)
dc.capacityReservations = newCapacityReservations()
dc.NodeImpl.value = dc
return dc
}