Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go/worker/compute: Only advertise active version for TEE runtimes #4683

Merged
merged 2 commits into from
Apr 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .changelog/4683.bugfix.md
Original file line number Diff line number Diff line change
@@ -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.
16 changes: 13 additions & 3 deletions go/worker/compute/executor/committee/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -1348,10 +1348,20 @@ 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
}

// 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
}
return nil
})
Expand Down