Skip to content

Commit

Permalink
Tim's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pkazmierczak committed Dec 16, 2024
1 parent bfd9fbd commit 24ab149
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
3 changes: 1 addition & 2 deletions scheduler/generic_sched.go
Original file line number Diff line number Diff line change
Expand Up @@ -942,8 +942,7 @@ func (s *GenericScheduler) findPreferredNode(place placementResult) (*structs.No
}

var preferredNode *structs.Node
ws := memdb.NewWatchSet()
preferredNode, err := s.state.NodeByID(ws, prev.NodeID)
preferredNode, err := s.state.NodeByID(nil, prev.NodeID)
if err != nil {
return nil, err
}
Expand Down
9 changes: 3 additions & 6 deletions scheduler/generic_sched_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,13 +316,11 @@ func TestServiceSched_JobRegister_StickyVolumes(t *testing.T) {
Status: structs.EvalStatusPending,
}
must.NoError(t, h.State.UpsertEvals(structs.MsgTypeTestSetup, h.NextIndex(), []*structs.Evaluation{eval}))
h1 := NewHarnessWithState(t, h.State)
must.NoError(t, h1.Process(NewServiceScheduler, eval))
must.NoError(t, h.Process(NewServiceScheduler, eval))

// Ensure we have created only one new allocation
// Ensure a single plan
must.SliceLen(t, 1, h1.Plans)
plan = h1.Plans[0]
must.SliceLen(t, 2, h.Plans)
plan = h.Plans[0]
var newPlanned []*structs.Allocation
for _, allocList := range plan.NodeAllocation {
newPlanned = append(newPlanned, allocList...)
Expand All @@ -331,7 +329,6 @@ func TestServiceSched_JobRegister_StickyVolumes(t *testing.T) {

// Ensure that the new allocations retain the host volume ID
for _, new := range newPlanned {
must.NotEq(t, new.PreviousAllocation, "")
must.Eq(t, new.HostVolumeIDs[0], dhv.ID)
}
}
Expand Down
1 change: 0 additions & 1 deletion scheduler/stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ type SelectOptions struct {
PreferredNodes []*structs.Node
Preempt bool
AllocName string
AllocID string
AllocationHostVolumeIDs []string
}

Expand Down

0 comments on commit 24ab149

Please sign in to comment.