Worker Versioning Garbage Collection Bug?

Hello :slight_smile:

Sadly we face an issue right now with the worker versioning garbage collection.

From the docs:

when you deploy your 101st Worker Version in a Worker Deployment, the server looks at the oldest drained version in the Worker deployment. If it has had no pollers in the last 5 minutes, the server deletes it

( Worker Versioning | Temporal Platform Documentation )

We are exactly in this situation. But instead of the expected behavior we now get bombarded with this error on the matching pod:

cannot add version #### since maximum number of versions (100) have been registered in the deployment

There are plenty of drained versions. These worker pods were also already deleted by the controller like expected.

Besides this issue we have no other so far with versioning or the worker controller.

Version deployed in K8n is: 1.29.1

Is this a bug? One that’s maybe solved in newer versions already? I’m already reading through patch notes and even commits to find something, but failed so far.

Have we just configured something wrong? A hint would be nice.

Best,
Sophie

Sophie, apologies for the long delay in responding to you. Would you mind letting us know the version of Temporal Worker Controller that you are using? And, to confirm, you are using Temporal Server v1.29.1 deployed in a self-hosted Kubernetes cluster, yes?

FYI, I was alerted to this community post via this Github bug/issue that linked here:

Please feel free to add any details to that issue.

Hello @Sophie , hoping things are well with you.

I work closely with @Jay_Pipes and would love to quickly chime in by saying that auto-deletion of drained, poller-less worker-versions when used specifically with the worker-controller was not working as expected in Temporal Versions v1.29.1 and below.

Having said that, we have patched and fixed this problem in this commit: ( Versioning bug: don't let the server set the last modifier identity to itself during garbage collection by Shivs11 · Pull Request #8614 · temporalio/temporal · GitHub ), which has made it’s first occurrence in Temporal Server Version v1.30.0. We are truly sorry that you are hitting this issue, but would it be possible for you to upgrade your server version to v1.30.0?

If not, we also do have a PR (in progress as we speak) which is aimed at deleting the worker-versions (Temporal Server Side) with calls that are initiating from the Temporal Worker Controller itself. This shall make the experience smoother for folks that are using the worker-controller but choose not to update the server version! I expect this PR to come out in a new worker-controller release quite soon.

The GC only kicks in on a drained version with zero pollers in the last 5 min, so the usual trap is that the pods are deleted but the versions never actually reached “drained” status, or something’s still polling them, so they never become eligible and you hit the hard 100 cap. Worth checking each stuck version’s drainage status and last-poll time directly. Given it’s 1.29.1, could well be a fixed bug, so worth pasting the version states when you file it with the team.