Operator requeue
Requeue 是佇列交付復原,不是重做業務決策。當 worker 在「資料庫已留下 pending/running 狀態」後崩潰,operator 可重新送出工作;處理器會利用既有 run / staged-change 狀態續跑。
Ops audience 本頁兩個 hotfix 端點只供受控平台 operator 使用,需要 CloudManager root credentials(
X-ADMIN-TOKEN、X-SUPER-TOKEN、X-CLOUD-TOKEN)。不可由租戶 UI、callback consumer 或一般 application job 呼叫。
Trigger run 批次 requeue
curl -X POST \
"$BASE_URL/root/hotfix/custom-table-trigger-runs/requeue?older_than_seconds=300&limit=500" \
-H "X-ADMIN-TOKEN: $ADMIN_TOKEN" \
-H "X-SUPER-TOKEN: $SUPER_TOKEN" \
-H "X-CLOUD-TOKEN: $CLOUD_TOKEN"它挑選超過門檻的 pending runs,以及 stale running runs;後者先重設為 pending。Worker 仍採 resume 語意,略過既有 action_results 中已成功的 actions。回應只有本次 requeued 數量:
{ "requeued": 14 }older_than_seconds 最小為 0、預設 300;limit 為 1..2000、預設 500。先用保守 limit,觀察 queue depth 與 downstream rate,再分批增加。
完整 contract 見 root.hotfix.triggerRunsRequeue。
Staged change 批次 requeue
Approval process 已通過,但 apply worker 未完成時,使用獨立端點:
curl -X POST \
"$BASE_URL/root/hotfix/custom-table-staged-changes/requeue?limit=500" \
-H "X-ADMIN-TOKEN: $ADMIN_TOKEN" \
-H "X-SUPER-TOKEN: $SUPER_TOKEN" \
-H "X-CLOUD-TOKEN: $CLOUD_TOKEN"它不會代替 reviewer 作決定,只復原已符合重新排隊條件的 staged-change apply。端點見 root.hotfix.stagedChangesRequeue。
選擇正確的恢復路徑
| 情境 | 使用方式 |
|---|---|
| Moderator 看見單一 failed run,已確認可以重試 | triggerRuns.retry |
| 多筆 pending enqueue 遺失或 workers crash | Root trigger-runs requeue |
| 已核准 staged change 卡在 apply 交付 | Root staged-changes requeue |
| Action 本身持續回 4xx 或設定錯誤 | 先修設定或 downstream;requeue 不會修正永久錯誤 |
每次操作都應記錄查詢參數、回應數量與前後 failed/stuck 指標;避免無界、緊密迴圈反覆 requeue。