Skip to content

Commit cb51a28

Browse files
committed
scheduler: persist changes to reconnected allocs
Reconnected allocs have a new AllocState entry that must be persisted by the plan applier.
1 parent 12f1ff5 commit cb51a28

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

scheduler/generic_sched.go

+6
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,12 @@ func (s *GenericScheduler) computeJobAllocs() error {
415415
s.plan.AppendUnknownAlloc(update)
416416
}
417417

418+
// Handle reconnect updates.
419+
// Reconnected allocs have a new AllocState entry.
420+
for _, update := range results.reconnectUpdates {
421+
s.ctx.Plan().AppendAlloc(update, nil)
422+
}
423+
418424
// Handle the in-place updates
419425
for _, update := range results.inplaceUpdate {
420426
if update.DeploymentID != s.deployment.GetID() {

scheduler/reconcile.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1206,7 +1206,7 @@ func (a *allocReconciler) computeReconnecting(reconnecting allocSet) {
12061206
// Use a copy to prevent mutating the object from statestore.
12071207
reconnectedAlloc := alloc.Copy()
12081208
reconnectedAlloc.AppendState(structs.AllocStateFieldClientStatus, alloc.ClientStatus)
1209-
a.result.reconnectUpdates[alloc.ID] = reconnectedAlloc
1209+
a.result.reconnectUpdates[reconnectedAlloc.ID] = reconnectedAlloc
12101210
}
12111211
}
12121212

0 commit comments

Comments
 (0)