Skip to content

Commit

Permalink
reconciler: 2 phase reconnects and tests (#12333)
Browse files Browse the repository at this point in the history
* structs: Add alloc.Expired & alloc.Reconnected functions. Add Reconnect eval trigger by.

* node_endpoint: Emit new eval for reconnecting unknown allocs.

* filterByTainted: handle 2 phase commit filtering rules.

* reconciler: Append AllocState on disconnect. Logic updates from testing and 2 phase reconnects.

* allocs: Set reconnect timestamp. Destroy if not DesiredStatusRun. Watch for unknown status.
  • Loading branch information
DerekStrickland authored and DerekStrickland committed Apr 5, 2022
1 parent 05093dd commit 903b871
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 4 deletions.
2 changes: 0 additions & 2 deletions nomad/structs/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -9923,10 +9923,8 @@ func (a *Allocation) DisconnectTimeout(now time.Time) time.Time {

tg := a.Job.LookupTaskGroup(a.TaskGroup)

// Prefer the duration from the task group.
timeout := tg.MaxClientDisconnect

// If not configured, return now
if timeout == nil {
return now
}
Expand Down
2 changes: 1 addition & 1 deletion scheduler/reconcile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ type resultExpectation struct {
attributeUpdates int
disconnectUpdates int
reconnectUpdates int
stop int
desiredTGUpdates map[string]*structs.DesiredUpdates
stop int
}

func assertResults(t *testing.T, r *reconcileResults, exp *resultExpectation) {
Expand Down
1 change: 0 additions & 1 deletion scheduler/reconcile_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@ func (a allocSet) filterByTainted(taintedNodes map[string]*structs.Node, support

// All other allocs are untainted
untainted[alloc.ID] = alloc

}

return
Expand Down

0 comments on commit 903b871

Please sign in to comment.