Worker controller created 1.31 million closed runs and 33GB visibility database for ~35k workflow runs over 6 months
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 18/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- go, postgresql
- 领域
- backend, database, performance
调研方向
Start from the worker-versioning system workflows named in the report (temporal-sys-worker-deployment-version-workflow and temporal-sys-worker-deployment-workflow) and the drainage refresh setting matching.wv.VersionDrainageStatusRefreshInterval; find where a refresh triggers continue-as-new. Reproduce with the count query in the steps while a version drains, and use the reported PostgreSQL visibility and persistence growth to confirm the cause. Done means a draining version no longer creates a closed run per refresh interval per workflow, without breaking drainage checks.
由索引模型根据 Issue 内容生成。
描述
Expected Behavior
A deployment with a fixed number of versions uses a roughly constant amount of persistence
and visibility storage for Worker Versioning's own bookkeeping, however long a version takes
to drain.
Actual Behavior
What happens
While a version is draining, the server re-checks its drainage status every
matching.wv.VersionDrainageStatusRefreshInterval (default 3m). Each check ends the current
run of that version's temporal-sys-worker-deployment-version-workflow and of the
deployment's temporal-sys-worker-deployment-workflow with continue-as-new, and starts a new
run of each.
Every run closed this way stays in the persistence and visibility stores until the namespace
retention period expires. A version that drains slowly, because a long-running pinned workflow
is still on it, therefore adds about 960 closed runs a day for as long as it drains. All of a
deployment's runs share one or two workflow ids, so they all sit on one history shard.
Consequences
In one namespace with 365-day retention:
- Since May this year, 1.31M of 1.34M stored executions are closed runs of these two workflow types
(TemporalNamespaceDivision = "TemporalWorkerDeployment",ExecutionStatus = "ContinuedAsNew"). - Those runs hold about 15 GB of history. All user workflows together hold about 6.7 GB.
- The visibility database is 33 GB, most of it rows and index entries for these runs.
- Storage keeps growing at that rate while any version is draining, with no user activity.
Attempting to remove the worker versioning runs results in a denial of service on the cluster due
to exploding retries with no backoff. A batch delete of them at 10 per second
(temporal workflow delete --query ... --rps 10) put every delete on the one shard that owns
those workflow ids. TransferDeleteExecution tasks exceeded their 3s timeout with
context deadline exceeded and were automatically retried by the server up to 30 times: 10,039 failures from 413 runs in
about four minutes, all on a single shard. During that window GetWorkflowExecution calls for
unrelated user workflows failed with the same error, and the frontend stopped answering CLI
requests. The batch kept starting deletes at the requested rate while they were failing.
Steps to Reproduce the Problem
- Run a server with a long namespace retention (ours is 365d) and Worker Versioning enabled.
- Deploy a version, start a long-running pinned workflow on it, then make a newer version
current so the first version stays in the draining state. - Leave it draining and run
temporal workflow count --query 'TemporalNamespaceDivision = "TemporalWorkerDeployment" AND ExecutionStatus = "ContinuedAsNew"'
periodically. The count rises by about two per refresh interval per draining version and
does not fall.
Specifications
- Version: 1.32.2 (server and admin-tools)
- Platform: self-hosted with Docker Compose on Linux; Supabase PostgreSQL 15 for persistence and
SQL visibility (postgres12plugin); 4 history shards
- 主要语言
- Go
- 星标
- 204
- 派生
- 88
- 平均合并
- 1 天 2 小时
- 30 天内合并 PR
- 10
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
temporalio/temporal-worker-controller 的其他 Issue
-
enhancement
难度 5/5 一周以上 新手友好度 38/100
temporalio/temporal-worker-controller#701 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
temporalio/temporal-worker-controller#699 · 1 条评论 ·
维护者通常 1 天内回复
-
[Feature Request] Make the rollback-detection window configurable可能已有人在做 @blaketsk 于 5 天前认领。 未关闭
难度 5/5 一周以上 新手友好度 45/100
temporalio/temporal-worker-controller#698 ·
维护者通常 1 天内回复
-
[Bug] Build id mismatch between controller and self-hosted server可能已有人在做 @kriyanshii 于 3 天前认领。 未关闭bug
难度 4/5 3-5 天 新手友好度 48/100
temporalio/temporal-worker-controller#693 · 1 条评论 ·
维护者通常 1 天内回复
-
[Feature Request] Allow customizing the names of controller injected environment variables可能重新可做 @rahulsjha 于 14 天前认领,目前没有进行中的 PR。 未关闭enhancement
难度 3/5 1-2 天 新手友好度 65/100
temporalio/temporal-worker-controller#692 · 2 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
查看 temporalio/temporal-worker-controller 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
seriousm4x/UpSnap#1786 ·
-
bug feedback ui/ux
难度 2/5 1-3 小时 新手友好度 67/100
peasant-labs/peasant#1307 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
connectrpc/conformance#1211 ·
维护者通常 1 天内回复
-
bug effort:s impact:med raised-by:desk risk:low
难度 2/5 1-3 小时 新手友好度 75/100
medici-finance/assay#8342 · 1 条评论 ·
维护者通常 1 天内回复
-
hardening
难度 2/5 1-3 小时 新手友好度 82/100
inference-sim/inference-sim#2821 ·
维护者通常 1 天内回复