From fb336907849fb44f236da1dd1889f51a5e0d9d6a Mon Sep 17 00:00:00 2001 From: Jernej Kos Date: Fri, 22 Apr 2022 12:55:39 +0200 Subject: [PATCH 1/2] go/worker/compute: Only advertise active version for TEE runtimes Previously this caused additional downtime on upgrades due to capability updates not being allowed. --- .changelog/4683.bugfix.md | 4 ++++ go/worker/compute/executor/committee/node.go | 11 ++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 .changelog/4683.bugfix.md diff --git a/.changelog/4683.bugfix.md b/.changelog/4683.bugfix.md new file mode 100644 index 00000000000..473d176f7ea --- /dev/null +++ b/.changelog/4683.bugfix.md @@ -0,0 +1,4 @@ +go/worker/compute: Only advertise active version for TEE runtimes + +Previously this caused additional downtime on upgrades due to capability +updates not being allowed. diff --git a/go/worker/compute/executor/committee/node.go b/go/worker/compute/executor/committee/node.go index 12f9ee07498..b646357e7a4 100644 --- a/go/worker/compute/executor/committee/node.go +++ b/go/worker/compute/executor/committee/node.go @@ -1348,10 +1348,15 @@ func (n *Node) nudgeAvailabilityLocked(force bool) { n.roleProvider.SetAvailable(func(nd *node.Node) error { for _, version := range n.commonNode.Runtime.HostVersions() { - rt := nd.AddOrUpdateRuntime(n.commonNode.Runtime.ID(), version) - if rt.Version == n.runtimeVersion { - rt.Capabilities.TEE = n.runtimeCapabilityTEE + // For TEE-enabled runtimes we can only advertise the active version as this will + // otherwise cause additional downtime on upgrades due to capability updates not + // being allowed. + if n.runtimeCapabilityTEE != nil && version != n.runtimeVersion { + continue } + + rt := nd.AddOrUpdateRuntime(n.commonNode.Runtime.ID(), version) + rt.Capabilities.TEE = n.runtimeCapabilityTEE } return nil }) From 103470b7ccdd836df3e29406e03b6e3194b43ef9 Mon Sep 17 00:00:00 2001 From: Jernej Kos Date: Fri, 22 Apr 2022 13:17:40 +0200 Subject: [PATCH 2/2] go/worker/compute: Do not advertise old versions --- go/worker/compute/executor/committee/node.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/go/worker/compute/executor/committee/node.go b/go/worker/compute/executor/committee/node.go index b646357e7a4..2f5a82b1d71 100644 --- a/go/worker/compute/executor/committee/node.go +++ b/go/worker/compute/executor/committee/node.go @@ -1355,6 +1355,11 @@ func (n *Node) nudgeAvailabilityLocked(force bool) { continue } + // Skip sending any old versions that will never be active again. + if version.ToU64() < n.runtimeVersion.ToU64() { + continue + } + rt := nd.AddOrUpdateRuntime(n.commonNode.Runtime.ID(), version) rt.Capabilities.TEE = n.runtimeCapabilityTEE }