Skip to content

Commit

Permalink
notes
Browse files Browse the repository at this point in the history
  • Loading branch information
pkazmierczak committed Dec 3, 2024
1 parent d9a644a commit 49428c3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions nomad/structs/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -11115,6 +11115,7 @@ type Allocation struct {
AllocatedResources *AllocatedResources

// VolumeID is the ID of the host volume that this allocation requires.
// FIXME:could be multiple, could be CSI? can't just be a string
VolumeID *string

// Metrics associated with this allocation
Expand Down
2 changes: 2 additions & 0 deletions scheduler/feasible.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ func (h *HostVolumeChecker) SetVolumes(allocName string, volumes map[string]*str
continue
}

// FIXME: if there's a sticky vol set, adjust this to look for an ID

if req.PerAlloc {
// provide a unique volume source per allocation
copied := req.Copy()
Expand Down
3 changes: 3 additions & 0 deletions scheduler/generic_sched.go
Original file line number Diff line number Diff line change
Expand Up @@ -894,11 +894,14 @@ func updateRescheduleTracker(alloc *structs.Allocation, prev *structs.Allocation

// findPreferredNode finds the preferred node for an allocation
func (s *GenericScheduler) findPreferredNode(place placementResult) (*structs.Node, error) {
// TODO: is previous allocation set on destrouctive updates?
prev := place.PreviousAllocation()
if prev == nil {
return nil, nil
}
if place.TaskGroup().EphemeralDisk.Sticky || place.TaskGroup().EphemeralDisk.Migrate {
// TODO: this could be a good place where we'd stick the sticky volume
// logic, to find the node that must have the right vol id
var preferredNode *structs.Node
ws := memdb.NewWatchSet()
preferredNode, err := s.state.NodeByID(ws, prev.NodeID)
Expand Down

0 comments on commit 49428c3

Please sign in to comment.