From a1fe33c994f46d6d8907c1b7cc4a01656a53508a Mon Sep 17 00:00:00 2001 From: Richard McDaniel <1130888+rmcdaniel@users.noreply.github.com> Date: Wed, 25 Nov 2026 13:03:12 +0000 Subject: [PATCH] Document guarded worker build and task queue retirement Replace the 'no guarded retirement' notes in the build-id rollout and compatibility routing guides with the promote, inspect, retire and recover journey from native Server 3.14.0, in all locales. Refs durable-workflow/server#519 Co-Authored-By: Claude Opus 5.5 --- docs/polyglot/worker-build-id-rollout.md | 104 +++++++++++++++--- docs/polyglot/worker-compatibility-routing.md | 13 ++- .../polyglot/worker-build-id-rollout.md | 60 +++++++++- .../polyglot/worker-compatibility-routing.md | 5 +- i18n/de/source-hashes.json | 4 +- .../polyglot/worker-build-id-rollout.md | 60 +++++++++- .../polyglot/worker-compatibility-routing.md | 5 +- i18n/es/source-hashes.json | 4 +- .../polyglot/worker-build-id-rollout.md | 60 +++++++++- .../polyglot/worker-compatibility-routing.md | 5 +- i18n/fr/source-hashes.json | 4 +- .../polyglot/worker-build-id-rollout.md | 60 +++++++++- .../polyglot/worker-compatibility-routing.md | 5 +- i18n/ja/source-hashes.json | 4 +- .../polyglot/worker-build-id-rollout.md | 60 +++++++++- .../polyglot/worker-compatibility-routing.md | 5 +- i18n/pt-BR/source-hashes.json | 4 +- .../polyglot/worker-build-id-rollout.md | 60 +++++++++- .../polyglot/worker-compatibility-routing.md | 5 +- i18n/uk/source-hashes.json | 4 +- .../polyglot/worker-build-id-rollout.md | 60 +++++++++- .../polyglot/worker-compatibility-routing.md | 5 +- i18n/zh-Hans/source-hashes.json | 4 +- 23 files changed, 512 insertions(+), 88 deletions(-) diff --git a/docs/polyglot/worker-build-id-rollout.md b/docs/polyglot/worker-build-id-rollout.md index 5dfc6332592..f5cf2b9aa5e 100644 --- a/docs/polyglot/worker-build-id-rollout.md +++ b/docs/polyglot/worker-build-id-rollout.md @@ -15,7 +15,8 @@ Before promoting a candidate, replay representative open and recently closed his Use this guide to inspect worker cohorts, choose the build for new workflow starts, and keep compatible workers available for existing runs. Promotion changes new-start selection. Draining stops new claims by the selected cohort. -Neither operation migrates existing runs or proves that a build can be deleted. +Neither operation migrates existing runs or proves that a build can be deleted; +[guarded retirement](#retire-a-build-or-queue) makes that decision. Read [Worker Compatibility and Routing](/docs/polyglot/worker-compatibility-routing) for the identity carried by workflow tasks, activities, retries, children and @@ -102,12 +103,11 @@ compatible capacity for leased work and future work from existing runs. A run waiting on a signal, timer, activity or child can have no pending workflow task now and still require the old build later. Activities can use other recorded queues. This endpoint does not establish safe retirement or authority to scale -the last required cohort to zero. +the last required cohort to zero; use [guarded retirement](#retire-a-build-or-queue). -[Server #519](https://github.com/durable-workflow/server/issues/519) tracks a -guarded retirement decision. [Server #534](https://github.com/durable-workflow/server/issues/534) -tracks the separate scrape/scale-to-zero capability. These are not delivered by -this checklist, and there is no documented built-in KEDA/HPA trigger here. +[Server #534](https://github.com/durable-workflow/server/issues/534) tracks the +separate scrape/scale-to-zero capability. There is no documented built-in +KEDA/HPA trigger here. ## First Cutover: Unversioned To Versioned {#first-cutover-unversioned-to-versioned} @@ -123,9 +123,9 @@ this checklist, and there is no documented built-in KEDA/HPA trigger here. 4. Keep compatible workers for existing histories. Promotion does not assign the new pin to old runs, and draining is not a migration. -5. Retire old capacity only when its remaining dependencies have been resolved - independently. Empty task counts and zero worker registrations are not that - proof. Keep the build artifact and recovery path while any run can need it. +5. Retire the old build with [guarded retirement](#retire-a-build-or-queue) + once its inventory is empty. Empty task counts and zero worker registrations + are not that proof. Keep the build artifact while any run can need it. ## Canary A New Build {#canary-a-new-build} @@ -181,7 +181,82 @@ dw task-queue:resume orders-critical --namespace orders-prod --build-id orders-v ``` Draining or stopping every worker is not proof that the build artifact is safe -to remove. There is no guarded retirement decision in this snapshot. +to remove. Drain remains the emergency stop: it refuses the build's polls +immediately, whether or not work is still pinned to it. Use +[guarded retirement](#retire-a-build-or-queue) to decide removal. + +## Retire A Build Or Queue {#retire-a-build-or-queue} + +Native Server 3.14.0 and later answer whether a build or queue can be removed +safely, and refuse to retire it while any live dependency remains. Require +`capabilities.worker_build_retirement` to be exactly `true` on +`GET /api/cluster/info`; published PHP Server does not serve these routes. Use +an operator or admin token and the namespace, like the other build-id routes. + +| Intent | HTTP endpoint | +| --- | --- | +| Inspect one build | `GET /api/deployments/{namespace}/{taskQueue}@{buildId}/retirement` (`@unversioned` for the unversioned cohort) | +| Retire one build | `POST /api/deployments/{namespace}/{taskQueue}@{buildId}/retire` | +| Inspect every cohort on a queue | `GET /api/task-queues/{taskQueue}/retirement` | +| Retire a queue | `POST /api/task-queues/{taskQueue}/retire` | + +1. Promote the replacement build and keep the old build's workers running. + They finish the runs still pinned to it, delayed retries, timers and + continued chains. +2. Inspect the old build until `retirable` is `true`: + + ```bash + dw task-queue:retirement orders-critical --namespace orders-prod --build-id orders-v1 --json + ``` + + Each blocker gives its exact `count`, up to 20 sample identities and a + `recovery` action: let the work finish, or cancel or terminate the runs you + choose to abandon. +3. Retire it, optionally bound to the inspected + `observation.inventory_revision`: + + ```bash + dw task-queue:retire orders-critical --namespace orders-prod --build-id orders-v1 \ + --expected-revision "$INVENTORY_REVISION" + ``` + +4. Stop the old build's processes only after the retire succeeds. + +Without `--build-id` or `--unversioned`, both commands act on every cohort on +the queue. These commands ship in the first CLI release after 2.11.0; with CLI +2.11.0 or earlier, call the HTTP routes directly. + +The inventory counts open runs pinned to the build (including waiting, +continued and child runs), ready, leased and delayed tasks (activity retries +and timers not yet due), open activities, pending update validations and, for a +queue, schedules that start runs on it. An open run with no recorded task queue +makes the inventory `incomplete`, and retirement is unavailable. + +Inspection is a preview. The retire action counts again inside the same +serialized transition that starts, retries and task creation take, and writes +only when nothing remains. A refused retire answers HTTP409 and changes +nothing; follow `expected_resolution` and inspect again. + +| `reason` | Meaning | +| --- | --- | +| `unknown_deployment`, `unknown_task_queue` | No worker registered and no rollout was recorded for the target. | +| `selected_for_new_starts` | New starts on the queue still select this build. Promote the replacement first. | +| `inventory_incomplete` | Unattributed open runs exist. Missing inventory is never permission to retire. | +| `live_dependencies` | At least one blocker has a nonzero count. | +| `inventory_changed` | The `expected_inventory_revision` no longer matches. | + +A successful retire returns HTTP200 with `outcome: "retired"`, `retired_at` and +`retired_by`. The build's rollout intent becomes the terminal `drained` state: +it is never selected for new starts, cannot be promoted or resumed through the +deployment lifecycle, and its workers stay draining. When every cohort on a +queue is retired and no active worker remains, new starts there are refused +with `task_queue_draining` and `routing_status: "retired"` until a new active +cohort registers. Run pins, activity queues, history and deadlines are +unchanged. + +To recover, `dw task-queue:resume` (`POST /api/task-queues/{taskQueue}/build-ids/resume`) +sets a retired build back to `active`; retirement guaranteed it had no work at +that time. ## Roll Back A Bad Build {#roll-back-a-bad-build} @@ -204,10 +279,13 @@ when they continue. Keep stored compatibility fields intact during recovery. | Promote for new starts | `POST /api/task-queues/{taskQueue}/build-ids/promote` | `dw task-queue:promote` | `Client.promote_task_queue_build_id` | | Drain | `POST /api/task-queues/{taskQueue}/build-ids/drain` | `dw task-queue:drain` | `Client.drain_task_queue_build_id` | | Resume | `POST /api/task-queues/{taskQueue}/build-ids/resume` | `dw task-queue:resume` | `Client.resume_task_queue_build_id` | +| Inspect retirement | `GET /api/task-queues/{taskQueue}/retirement`, `GET /api/deployments/{name}/retirement` | `dw task-queue:retirement` | — | +| Retire | `POST /api/task-queues/{taskQueue}/retire`, `POST /api/deployments/{name}/retire` | `dw task-queue:retire` | — | -These mutation routes accept `{"build_id":"orders-v2"}` or `{"build_id":null}` -for the unversioned cohort. CLI mutation commands use `--build-id` or -`--unversioned`, never both. +The promote, drain and resume routes accept `{"build_id":"orders-v2"}` or +`{"build_id":null}` for the unversioned cohort. The retire routes take an +optional `{"expected_inventory_revision":"..."}` body. CLI mutation commands use +`--build-id` or `--unversioned`, never both. For the complete lifecycle, use `GET /api/deployments` and `POST /api/deployments/{name}/{promote,drain,resume,rollback}`. Use the returned diff --git a/docs/polyglot/worker-compatibility-routing.md b/docs/polyglot/worker-compatibility-routing.md index dfac8f45d9c..075c813c874 100644 --- a/docs/polyglot/worker-compatibility-routing.md +++ b/docs/polyglot/worker-compatibility-routing.md @@ -96,11 +96,14 @@ rebuilds; changing a label does not make incompatible workflow code replay safel early drain strands work, resume and restore the original compatible build. 5. To roll back new starts, restore/resume and promote the known-good cohort, then roll back the bad deployment. Existing pins remain unchanged. +6. Inspect the old build's retirement inventory and retire it with the + [guarded retire action](/docs/polyglot/worker-build-id-rollout#retire-a-build-or-queue) + before stopping its workers. -Zero pending workflow tasks does not establish safe retirement. Retain the -artifact and recovery path while any pinned run or inherited chain can need -it. [Server #519](https://github.com/durable-workflow/server/issues/519) tracks -the separate guarded retirement capability; this checklist does not deliver it. +Zero pending workflow tasks does not establish safe retirement. Native Server +3.14.0 and later count the pinned runs, delayed retries, timers, activities, +update validations and schedules that still depend on a build or queue, and +refuse to retire it with HTTP409 while any remain. ## Explicit missing-worker state {#explicit-missing-worker-state} @@ -117,7 +120,7 @@ its queue, namespace and workflow-type declarations before adding unrelated work Rollout state describes registered capacity and new-start/lifecycle intent; compatibility determines whether a specific original task can be claimed. Use both. Neither a drain nor a rollback rewrites durable compatibility or -proves that a build can be removed. +proves that a build can be removed; the guarded retirement inventory decides that. ## Related references {#related-references} diff --git a/i18n/de/docusaurus-plugin-content-docs/current/polyglot/worker-build-id-rollout.md b/i18n/de/docusaurus-plugin-content-docs/current/polyglot/worker-build-id-rollout.md index 316b61f9787..468b85bddbe 100644 --- a/i18n/de/docusaurus-plugin-content-docs/current/polyglot/worker-build-id-rollout.md +++ b/i18n/de/docusaurus-plugin-content-docs/current/polyglot/worker-build-id-rollout.md @@ -12,7 +12,7 @@ keywords: [Worker-Build-ID, Worker entleeren, Worker-Rollback, Canary, unversion Prüfen Sie vor der Promotion eines Kandidaten repräsentative offene und kürzlich geschlossene Historien gegen dessen genauen Anwendungscode. Prüfen Sie vor einem Rollback die Historien des neueren Builds gegen das ältere Artefakt. Nutzen Sie die [Replay-Prüfung](../testing.md#replay-before-deployment); eine kompatible Routing-Kohorte oder erfolgreiche Integritätsprüfung allein beweist keine Replay-Kompatibilität. -Prüfen Sie mit diesem Leitfaden Worker-Kohorten und wählen Sie den Build für neue Workflow-Starts. Halten Sie kompatible Worker für bestehende Läufe bereit. Eine Promotion ändert die Auswahl für neue Starts; Drain verhindert neue Claims der Kohorte. Keine dieser Aktionen migriert vorhandene Läufe oder beweist, dass ein Build gelöscht werden kann. +Prüfen Sie mit diesem Leitfaden Worker-Kohorten und wählen Sie den Build für neue Workflow-Starts. Halten Sie kompatible Worker für bestehende Läufe bereit. Eine Promotion ändert die Auswahl für neue Starts; Drain verhindert neue Claims der Kohorte. Keine dieser Aktionen migriert vorhandene Läufe oder beweist, dass ein Build gelöscht werden kann; diese Entscheidung trifft die [abgesicherte Stilllegung](#retire-a-build-or-queue). [Worker-Kompatibilität und Routing](/docs/polyglot/worker-compatibility-routing) erklärt die Identität von Workflow-Tasks, Aktivitäten, Wiederholungen, Kindern und Continue-as-new. Eine Kohorte ist durch `(namespace, task_queue, build_id)` abgegrenzt. Registrierungen ohne `build_id` gehören zur unversionierten `null`-Kohorte. @@ -78,9 +78,9 @@ Die unversionierte Kohorte erhält diese buildbezogene Diagnose nicht. Ein fehle Beispielsweise kann der alte Build zwei bereite und einen geleasten Task haben, der neue dagegen keinen. Eine Queue-Gesamtsumme von drei zeigt nicht, welche Flotte Kapazität benötigt. Hat der alte Build keine aktiven Worker, stellen Sie dessen kompatible Kapazität wieder her oder setzen Sie ihn bei versehentlichem Drain gezielt fort. Neue Worker eines anderen Builds übernehmen alte Pins nicht. Prüfen Sie bei ausschließlich veralteten Registrierungen verlorene Prozesse oder Heartbeats, bevor Sie diese als Kapazität zählen. -Reduzieren Sie Kohorten vorsichtig und prüfen Sie ihre eigenen Task-Zahlen, frischen Worker, Workflow-Typen, freien Slots und Drain-Absichten. Erhalten Sie Kapazität für geleaste sowie spätere Arbeit bestehender Läufe. Ein auf Signal, Timer, Aktivität oder Kind wartender Lauf kann derzeit keinen Workflow-Task haben und später den alten Build benötigen. Aktivitäten können andere gespeicherte Queues verwenden. Dieser Endpunkt erteilt weder eine sichere Stilllegungsentscheidung noch die Berechtigung, die letzte benötigte Kohorte auf null zu skalieren. +Reduzieren Sie Kohorten vorsichtig und prüfen Sie ihre eigenen Task-Zahlen, frischen Worker, Workflow-Typen, freien Slots und Drain-Absichten. Erhalten Sie Kapazität für geleaste sowie spätere Arbeit bestehender Läufe. Ein auf Signal, Timer, Aktivität oder Kind wartender Lauf kann derzeit keinen Workflow-Task haben und später den alten Build benötigen. Aktivitäten können andere gespeicherte Queues verwenden. Dieser Endpunkt erteilt weder eine sichere Stilllegungsentscheidung noch die Berechtigung, die letzte benötigte Kohorte auf null zu skalieren; nutzen Sie dafür die [abgesicherte Stilllegung](#retire-a-build-or-queue). -[Server #519](https://github.com/durable-workflow/server/issues/519) verfolgt eine abgesicherte Stilllegungsentscheidung, [Server #534](https://github.com/durable-workflow/server/issues/534) die separate Scrape-/Scale-to-zero-Funktion. Diese Checkliste liefert beides nicht; hier ist kein eingebauter KEDA-/HPA-Trigger dokumentiert. +[Server #534](https://github.com/durable-workflow/server/issues/534) verfolgt die separate Scrape-/Scale-to-zero-Funktion. Hier ist kein eingebauter KEDA-/HPA-Trigger dokumentiert. ## Erster Wechsel von unversioniert zu versioniert {#first-cutover-unversioned-to-versioned} @@ -93,7 +93,7 @@ Reduzieren Sie Kohorten vorsichtig und prüfen Sie ihre eigenen Task-Zahlen, fri ``` 4. Erhalten Sie kompatible Worker für bestehende Historien. Promotion ändert alte Pins nicht; Drain ist keine Migration. -5. Entfernen Sie alte Kapazität erst, wenn ihre übrigen Abhängigkeiten unabhängig geklärt sind. Leere Task-Zähler oder null Registrierungen reichen nicht. Erhalten Sie Artefakt und Wiederherstellungsweg, solange ein Lauf den Build benötigen kann. +5. Legen Sie den alten Build mit der [abgesicherten Stilllegung](#retire-a-build-or-queue) still, sobald sein Inventar leer ist. Leere Task-Zähler oder null Registrierungen sind dafür kein Nachweis. Erhalten Sie das Build-Artefakt, solange ein Lauf es benötigen kann. ## Canary für einen neuen Build {#canary-a-new-build} @@ -123,7 +123,53 @@ Drainen Sie nicht allein deshalb, weil der neue Build eigene Arbeit übernehmen dw task-queue:resume orders-critical --namespace orders-prod --build-id orders-v1 ``` -Drain oder das Stoppen aller Worker beweist nicht, dass das Build-Artefakt gelöscht werden darf. Dieser Snapshot enthält keine abgesicherte Stilllegungsentscheidung. +Drain oder das Stoppen aller Worker beweist nicht, dass das Build-Artefakt gelöscht werden darf. Drain bleibt der Notstopp: Er lehnt die Polls des Builds sofort ab, unabhängig davon, ob noch Arbeit an ihn gepinnt ist. Über das Entfernen entscheidet die [abgesicherte Stilllegung](#retire-a-build-or-queue). + +## Build oder Queue stilllegen {#retire-a-build-or-queue} + +Native Server 3.14.0 und neuer beantworten, ob ein Build oder eine Queue sicher entfernt werden kann, und verweigern die Stilllegung, solange eine aktive Abhängigkeit besteht. Setzen Sie voraus, dass `capabilities.worker_build_retirement` in `GET /api/cluster/info` exakt `true` ist; der veröffentlichte PHP-Server bedient diese Routen nicht. Verwenden Sie wie bei den anderen Build-ID-Routen ein Operator- oder Admin-Token und den Namespace. + +| Absicht | HTTP-Endpunkt | +| --- | --- | +| Einen Build prüfen | `GET /api/deployments/{namespace}/{taskQueue}@{buildId}/retirement` (`@unversioned` für die unversionierte Kohorte) | +| Einen Build stilllegen | `POST /api/deployments/{namespace}/{taskQueue}@{buildId}/retire` | +| Alle Kohorten einer Queue prüfen | `GET /api/task-queues/{taskQueue}/retirement` | +| Eine Queue stilllegen | `POST /api/task-queues/{taskQueue}/retire` | + +1. Promoten Sie den Ersatz-Build und lassen Sie die Worker des alten Builds weiterlaufen. Sie beenden die noch an ihn gepinnten Läufe, verzögerten Retries, Timer und fortgesetzten Ketten. +2. Prüfen Sie den alten Build, bis `retirable` den Wert `true` hat: + + ```bash + dw task-queue:retirement orders-critical --namespace orders-prod --build-id orders-v1 --json + ``` + + Jeder Blocker nennt seinen exakten `count`, bis zu 20 Beispielidentitäten und eine `recovery`-Aktion: die Arbeit abschließen lassen oder Läufe, die Sie aufgeben, abbrechen oder beenden. +3. Legen Sie ihn still, optional gebunden an die geprüfte `observation.inventory_revision`: + + ```bash + dw task-queue:retire orders-critical --namespace orders-prod --build-id orders-v1 \ + --expected-revision "$INVENTORY_REVISION" + ``` + +4. Stoppen Sie die Prozesse des alten Builds erst, nachdem die Stilllegung erfolgreich war. + +Ohne `--build-id` oder `--unversioned` wirken beide Befehle auf alle Kohorten der Queue. Die Befehle erscheinen im ersten CLI-Release nach 2.11.0; mit CLI 2.11.0 oder älter rufen Sie die HTTP-Routen direkt auf. + +Das Inventar zählt offene, an den Build gepinnte Läufe (einschließlich wartender, fortgesetzter und Kind-Läufe), bereite, geleaste und verzögerte Tasks (noch nicht fällige Aktivitäts-Retries und Timer), offene Aktivitäten, ausstehende Update-Validierungen und bei einer Queue die Schedules, die Läufe auf ihr starten. Ein offener Lauf ohne gespeicherte Task-Queue macht das Inventar `incomplete`; dann ist keine Stilllegung möglich. + +Die Prüfung ist eine Vorschau. Die Stilllegung zählt in derselben serialisierten Transition erneut, die auch Starts, Retries und die Task-Erzeugung verwenden, und schreibt nur, wenn nichts übrig ist. Eine abgelehnte Stilllegung liefert HTTP409 und ändert nichts; folgen Sie `expected_resolution` und prüfen Sie erneut. + +| `reason` | Bedeutung | +| --- | --- | +| `unknown_deployment`, `unknown_task_queue` | Für das Ziel ist kein Worker registriert und kein Rollout gespeichert. | +| `selected_for_new_starts` | Neue Starts auf der Queue wählen noch diesen Build. Promoten Sie zuerst den Ersatz. | +| `inventory_incomplete` | Es gibt nicht zugeordnete offene Läufe. Fehlendes Inventar ist nie eine Erlaubnis zur Stilllegung. | +| `live_dependencies` | Mindestens ein Blocker hat einen Zähler ungleich null. | +| `inventory_changed` | Die `expected_inventory_revision` stimmt nicht mehr überein. | + +Eine erfolgreiche Stilllegung liefert HTTP200 mit `outcome: "retired"`, `retired_at` und `retired_by`. Die Rollout-Absicht des Builds wird zum endgültigen Zustand `drained`: Er wird nie mehr für neue Starts gewählt, kann über den Deployment-Lebenszyklus weder promotet noch fortgesetzt werden, und seine Worker bleiben im Drain. Sind alle Kohorten einer Queue stillgelegt und ist kein aktiver Worker übrig, werden neue Starts dort mit `task_queue_draining` und `routing_status: "retired"` abgelehnt, bis sich eine neue aktive Kohorte registriert. Lauf-Pins, Aktivitäts-Queues, Historie und Fristen bleiben unverändert. + +Zur Wiederherstellung setzt `dw task-queue:resume` (`POST /api/task-queues/{taskQueue}/build-ids/resume`) einen stillgelegten Build wieder auf `active`; die Stilllegung hat garantiert, dass er zu diesem Zeitpunkt keine Arbeit hatte. ## Fehlerhaften Build zurückrollen {#roll-back-a-bad-build} @@ -139,8 +185,10 @@ Wiederholungsversuche, untergeordnete Läufe und gewöhnliches Continue-as-new | Neue Starts auswählen | `POST /api/task-queues/{taskQueue}/build-ids/promote` | `dw task-queue:promote` | `Client.promote_task_queue_build_id` | | Drainen | `POST /api/task-queues/{taskQueue}/build-ids/drain` | `dw task-queue:drain` | `Client.drain_task_queue_build_id` | | Fortsetzen | `POST /api/task-queues/{taskQueue}/build-ids/resume` | `dw task-queue:resume` | `Client.resume_task_queue_build_id` | +| Stilllegung prüfen | `GET /api/task-queues/{taskQueue}/retirement`, `GET /api/deployments/{name}/retirement` | `dw task-queue:retirement` | — | +| Stilllegen | `POST /api/task-queues/{taskQueue}/retire`, `POST /api/deployments/{name}/retire` | `dw task-queue:retire` | — | -Diese Mutationen akzeptieren `{"build_id":"orders-v2"}` oder für die unversionierte Kohorte `{"build_id":null}`. CLI-Mutationen verwenden entweder `--build-id` oder `--unversioned`, niemals beides. +Promote-, Drain- und Resume-Routen akzeptieren `{"build_id":"orders-v2"}` oder für die unversionierte Kohorte `{"build_id":null}`. Die Retire-Routen nehmen einen optionalen Body `{"expected_inventory_revision":"..."}`. CLI-Mutationen verwenden entweder `--build-id` oder `--unversioned`, niemals beides. Den vollständigen Lebenszyklus bieten `GET /api/deployments` und `POST /api/deployments/{name}/{promote,drain,resume,rollback}`. Verwenden Sie den zurückgegebenen Namen, etwa `orders-prod/orders-critical@orders-v2`, im ursprünglichen Namespace. Auf dem veröffentlichten Apache-Pfad muss der Schrägstrich des Namens erhalten bleiben: vollständiges Kodieren des zusammengesetzten Namens kann vor Erreichen der API eine Apache-HTML404 auslösen. Abgelehnte Aktionen liefern HTTP409 mit typisiertem `reason` und `blockages`-Array. Prüfen Sie `expected_resolution`; eine Ablehnung ist keine erfolgreiche Promotion. [Server #521](https://github.com/durable-workflow/server/issues/521) betrifft den unvollständigen aktuellen OpenAPI-Spiegel, keine neue Runtime oder Änderung eingefrorener Schemas. diff --git a/i18n/de/docusaurus-plugin-content-docs/current/polyglot/worker-compatibility-routing.md b/i18n/de/docusaurus-plugin-content-docs/current/polyglot/worker-compatibility-routing.md index 609e7d5a1d9..ef2b8b20e33 100644 --- a/i18n/de/docusaurus-plugin-content-docs/current/polyglot/worker-compatibility-routing.md +++ b/i18n/de/docusaurus-plugin-content-docs/current/polyglot/worker-compatibility-routing.md @@ -73,8 +73,9 @@ Der erste Wert pinnt neue Embedded-Läufe; der zweite erlaubt Claims für diese 3. Erhalten Sie kompatible Kapazität für bestehende Pins, auch für passive Läufe, die auf Timer, Signal, Aktivität oder Kind warten. 4. Drainen Sie nur, wenn neue Claims dieser Kohorte absichtlich gestoppt werden sollen. Bei blockierter Arbeit nach frühem Drain setzen Sie fort und stellen den ursprünglichen kompatiblen Build wieder her. 5. Für einen Rollback neuer Starts stellen Sie die bekannte funktionierende Kohorte wieder her, setzen sie fort und promoten sie; rollen Sie dann das schlechte Deployment zurück. Bestehende Pins bleiben erhalten. +6. Prüfen Sie das Stilllegungsinventar des alten Builds und legen Sie ihn mit der [abgesicherten Stilllegung](/docs/polyglot/worker-build-id-rollout#retire-a-build-or-queue) still, bevor Sie seine Worker stoppen. -Null ausstehende Workflow-Tasks beweisen keine sichere Stilllegung. Erhalten Sie Artefakt und Wiederherstellungsweg, solange ein gepinnter Lauf oder eine geerbte Kette sie benötigen kann. [Server #519](https://github.com/durable-workflow/server/issues/519) verfolgt die separate abgesicherte Stilllegung; diese Checkliste liefert sie nicht. +Null ausstehende Workflow-Tasks beweisen keine sichere Stilllegung. Native Server 3.14.0 und neuer zählen gepinnte Läufe, verzögerte Retries, Timer, Aktivitäten, Update-Validierungen und Schedules, die noch von einem Build oder einer Queue abhängen, und verweigern die Stilllegung mit HTTP409, solange welche übrig sind. ## Sichtbarer Zustand bei fehlenden Workern {#explicit-missing-worker-state} @@ -82,7 +83,7 @@ Prüfen Sie [Workflow-Tasks pro Kohorte](/docs/polyglot/worker-build-id-rollout# ## Zusammenhang mit Build-ID-Rollouts {#how-this-relates-to-build-id-rollouts} -Der Rollout-Zustand beschreibt registrierte Kapazität sowie neue Start- und Lebenszyklusabsichten; Kompatibilität bestimmt den Claim eines konkreten ursprünglichen Tasks. Nutzen Sie beides. Weder Drain noch Rollback schreibt dauerhafte Kompatibilität um oder beweist, dass ein Build entfernt werden darf. +Der Rollout-Zustand beschreibt registrierte Kapazität sowie neue Start- und Lebenszyklusabsichten; Kompatibilität bestimmt den Claim eines konkreten ursprünglichen Tasks. Nutzen Sie beides. Weder Drain noch Rollback schreibt dauerhafte Kompatibilität um oder beweist, dass ein Build entfernt werden darf; das entscheidet das Inventar der abgesicherten Stilllegung. ## Weitere Referenzen {#related-references} diff --git a/i18n/de/source-hashes.json b/i18n/de/source-hashes.json index 9a91b96e8f1..235b9dcc593 100644 --- a/i18n/de/source-hashes.json +++ b/i18n/de/source-hashes.json @@ -98,8 +98,8 @@ "polyglot/task-matching-dispatch.md": "9c8ffbbee16b5da48e7882721d7ba8eac209a374a6ca766d93d2b17e825b203d", "polyglot/task-queue-admission.md": "efcf934876a27c153dd3ecd1a995e7c08b37452c79dfcbba1ae7fa0a8cbad327", "polyglot/visibility-query-language.md": "15790074c904c6cdbb1de8dfade95ea9ca6391f2f16412db517a2fb84ef08334", - "polyglot/worker-build-id-rollout.md": "da8d837abf5d3aea049b1cd9d2ec906afd0f5f32e7340f459f1aaf664c6c6b5a", - "polyglot/worker-compatibility-routing.md": "ef58f23c112f0e6b968927ba861177903adca21ed33b6b9371681e23a18b2994", + "polyglot/worker-build-id-rollout.md": "822de3400c55367511c69de02f540845a9569e7d8be63bcf062f938a9acfeb82", + "polyglot/worker-compatibility-routing.md": "b05150fe1e18ff6dcc6e8047bd445f5ef3522540f2102981d89c65e45770bb69", "polyglot/worker-protocol.md": "91b18b39d626c1288bfa3f6b8212fa8246aa14393cb489a39fe90379bc4cd4b2", "polyglot/workflow-signals.md": "cfef2937ff4052ebd00494cdec522ef9c830d58389dfd249342d667d5c583839", "polyglot/workflow-streams.md": "5675a8ea1b9d0b1f7223fecb90b3b048d3006670bf505950bc783709287a6432", diff --git a/i18n/es/docusaurus-plugin-content-docs/current/polyglot/worker-build-id-rollout.md b/i18n/es/docusaurus-plugin-content-docs/current/polyglot/worker-build-id-rollout.md index 71eba4a49c8..fca069d4ce8 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/polyglot/worker-build-id-rollout.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/polyglot/worker-build-id-rollout.md @@ -12,7 +12,7 @@ keywords: [compilación de workers, drenaje, reversión, canary, workers sin ver Antes de promover un candidato, reproduzca historiales representativos abiertos y cerrados recientemente con su código exacto. Antes de revertir, reproduzca los historiales escritos por el build nuevo con el artefacto antiguo. Siga la [comprobación de replay](../testing.md#replay-before-deployment); una cohorte de enrutamiento compatible o una comprobación de integridad satisfactoria no demuestra, por sí sola, compatibilidad de replay. -Usa esta guía para inspeccionar cohortes, elegir la compilación de los nuevos workflows y mantener workers compatibles con las ejecuciones existentes. La promoción cambia la selección de nuevos inicios; el drenaje impide nuevas reclamaciones por esa cohorte. Ninguna operación migra ejecuciones ni demuestra que se pueda eliminar una compilación. +Usa esta guía para inspeccionar cohortes, elegir la compilación de los nuevos workflows y mantener workers compatibles con las ejecuciones existentes. La promoción cambia la selección de nuevos inicios; el drenaje impide nuevas reclamaciones por esa cohorte. Ninguna operación migra ejecuciones ni demuestra que se pueda eliminar una compilación; esa decisión corresponde a la [retirada protegida](#retire-a-build-or-queue). [Compatibilidad y enrutamiento de workers](/docs/polyglot/worker-compatibility-routing) explica la identidad de tareas, actividades, reintentos, hijos y continue-as-new. Una cohorte tiene el ámbito `(namespace, task_queue, build_id)`. Los registros sin `build_id` pertenecen a la cohorte sin versión, `null`. @@ -78,9 +78,9 @@ La cohorte sin versión no recibe ese diagnóstico específico de compilación. La compilación antigua puede tener dos tareas listas y una arrendada mientras la nueva no tiene pendientes. Un total de tres en la cola no identifica qué flota necesita capacidad. Si la antigua no tiene workers activos, restaura su capacidad compatible o reanúdala si se drenó por error. Añadir workers nuevos no consume trabajo fijado a la antigua. Si solo hay registros obsoletos, investiga procesos o heartbeats perdidos antes de contarlos como capacidad disponible. -Reduce cada cohorte con cautela tras revisar sus tareas, workers recientes, tipos declarados, plazas disponibles e intención de drenaje. Conserva capacidad para concesiones y futuras tareas de ejecuciones existentes. Una ejecución que espera señal, temporizador, actividad o hijo puede no tener tareas de workflow ahora y necesitar la compilación antigua después. Las actividades pueden utilizar otras colas registradas. Este endpoint no determina la retirada segura ni autoriza reducir a cero la última cohorte necesaria. +Reduce cada cohorte con cautela tras revisar sus tareas, workers recientes, tipos declarados, plazas disponibles e intención de drenaje. Conserva capacidad para concesiones y futuras tareas de ejecuciones existentes. Una ejecución que espera señal, temporizador, actividad o hijo puede no tener tareas de workflow ahora y necesitar la compilación antigua después. Las actividades pueden utilizar otras colas registradas. Este endpoint no determina la retirada segura ni autoriza reducir a cero la última cohorte necesaria; para eso usa la [retirada protegida](#retire-a-build-or-queue). -[Server #519](https://github.com/durable-workflow/server/issues/519) sigue la decisión protegida de retirada; [Server #534](https://github.com/durable-workflow/server/issues/534), la capacidad separada de recolección y reducción a cero. Esta lista no entrega esas funciones ni documenta un activador KEDA/HPA integrado. +[Server #534](https://github.com/durable-workflow/server/issues/534) sigue la capacidad separada de recolección y reducción a cero. Aquí no se documenta un activador KEDA/HPA integrado. ## Primer cambio de sin versión a versionado {#first-cutover-unversioned-to-versioned} @@ -93,7 +93,7 @@ Reduce cada cohorte con cautela tras revisar sus tareas, workers recientes, tipo ``` 4. Mantén workers compatibles con los historiales existentes. La promoción no modifica fijaciones antiguas; drenar no es migrar. -5. Retira capacidad antigua solo cuando se hayan resuelto independientemente sus dependencias restantes. Los contadores vacíos o cero registros no bastan. Conserva el artefacto y la recuperación mientras alguna ejecución pueda necesitarlo. +5. Retira la compilación antigua con la [retirada protegida](#retire-a-build-or-queue) cuando su inventario esté vacío. Los contadores vacíos o cero registros no lo demuestran. Conserva el artefacto mientras alguna ejecución pueda necesitarlo. ## Canary de una compilación nueva {#canary-a-new-build} @@ -123,7 +123,53 @@ No lo hagas solo porque la nueva compilación pueda reclamar su propio trabajo: dw task-queue:resume orders-critical --namespace orders-prod --build-id orders-v1 ``` -Drenar o detener todos los workers no demuestra que se pueda eliminar el artefacto. Esta instantánea no incluye una decisión protegida de retirada. +Drenar o detener todos los workers no demuestra que se pueda eliminar el artefacto. El drenaje sigue siendo la parada de emergencia: rechaza de inmediato los sondeos de la compilación, quede o no trabajo fijado a ella. Usa la [retirada protegida](#retire-a-build-or-queue) para decidir su eliminación. + +## Retirar una compilación o una cola {#retire-a-build-or-queue} + +Native Server 3.14.0 y posteriores indican si una compilación o una cola puede eliminarse con seguridad, y rechazan retirarla mientras quede alguna dependencia viva. Exige que `capabilities.worker_build_retirement` sea exactamente `true` en `GET /api/cluster/info`; el Server PHP publicado no ofrece estas rutas. Usa un token de operador o administrador y el namespace, como en las demás rutas de build-id. + +| Intención | Endpoint HTTP | +| --- | --- | +| Inspeccionar una compilación | `GET /api/deployments/{namespace}/{taskQueue}@{buildId}/retirement` (`@unversioned` para la cohorte sin versión) | +| Retirar una compilación | `POST /api/deployments/{namespace}/{taskQueue}@{buildId}/retire` | +| Inspeccionar todas las cohortes de una cola | `GET /api/task-queues/{taskQueue}/retirement` | +| Retirar una cola | `POST /api/task-queues/{taskQueue}/retire` | + +1. Promueve la compilación de reemplazo y mantén en marcha los workers de la antigua. Terminan las ejecuciones todavía fijadas a ella, los reintentos diferidos, los temporizadores y las cadenas continuadas. +2. Inspecciona la compilación antigua hasta que `retirable` sea `true`: + + ```bash + dw task-queue:retirement orders-critical --namespace orders-prod --build-id orders-v1 --json + ``` + + Cada bloqueo indica su `count` exacto, hasta 20 identidades de muestra y una acción `recovery`: dejar que el trabajo termine, o cancelar o terminar las ejecuciones que decidas abandonar. +3. Retírala, opcionalmente vinculada a la `observation.inventory_revision` inspeccionada: + + ```bash + dw task-queue:retire orders-critical --namespace orders-prod --build-id orders-v1 \ + --expected-revision "$INVENTORY_REVISION" + ``` + +4. Detén los procesos de la compilación antigua solo después de que la retirada tenga éxito. + +Sin `--build-id` ni `--unversioned`, ambos comandos actúan sobre todas las cohortes de la cola. Estos comandos se incluyen en la primera versión de la CLI posterior a 2.11.0; con la CLI 2.11.0 o anterior, llama directamente a las rutas HTTP. + +El inventario cuenta las ejecuciones abiertas fijadas a la compilación (incluidas las que esperan, las continuadas y las hijas), las tareas listas, concedidas y diferidas (reintentos de actividad y temporizadores aún no vencidos), las actividades abiertas, las validaciones de actualización pendientes y, para una cola, las programaciones que inician ejecuciones en ella. Una ejecución abierta sin cola de tareas registrada deja el inventario `incomplete`, y la retirada no está disponible. + +La inspección es una vista previa. La retirada vuelve a contar dentro de la misma transición serializada que usan los inicios, los reintentos y la creación de tareas, y solo escribe cuando no queda nada. Una retirada rechazada responde HTTP409 y no cambia nada; sigue `expected_resolution` y vuelve a inspeccionar. + +| `reason` | Significado | +| --- | --- | +| `unknown_deployment`, `unknown_task_queue` | No hay ningún worker registrado ni despliegue registrado para el destino. | +| `selected_for_new_starts` | Los nuevos inicios de la cola todavía seleccionan esta compilación. Promueve primero el reemplazo. | +| `inventory_incomplete` | Existen ejecuciones abiertas sin atribuir. La falta de inventario nunca autoriza una retirada. | +| `live_dependencies` | Al menos un bloqueo tiene un contador distinto de cero. | +| `inventory_changed` | La `expected_inventory_revision` ya no coincide. | + +Una retirada correcta devuelve HTTP200 con `outcome: "retired"`, `retired_at` y `retired_by`. La intención de despliegue de la compilación pasa al estado terminal `drained`: nunca se selecciona para nuevos inicios, no puede promoverse ni reanudarse mediante el ciclo de vida del despliegue y sus workers siguen drenando. Cuando todas las cohortes de una cola están retiradas y no queda ningún worker activo, los nuevos inicios en ella se rechazan con `task_queue_draining` y `routing_status: "retired"` hasta que se registre una nueva cohorte activa. Las fijaciones de ejecución, las colas de actividad, el historial y los plazos no cambian. + +Para recuperar, `dw task-queue:resume` (`POST /api/task-queues/{taskQueue}/build-ids/resume`) devuelve una compilación retirada a `active`; la retirada garantizó que no tenía trabajo en ese momento. ## Revertir una compilación defectuosa {#roll-back-a-bad-build} @@ -139,8 +185,10 @@ Los reintentos, las ejecuciones hijas y el continue-as-new habitual heredan la f | Seleccionar nuevos inicios | `POST /api/task-queues/{taskQueue}/build-ids/promote` | `dw task-queue:promote` | `Client.promote_task_queue_build_id` | | Drenar | `POST /api/task-queues/{taskQueue}/build-ids/drain` | `dw task-queue:drain` | `Client.drain_task_queue_build_id` | | Reanudar | `POST /api/task-queues/{taskQueue}/build-ids/resume` | `dw task-queue:resume` | `Client.resume_task_queue_build_id` | +| Inspeccionar la retirada | `GET /api/task-queues/{taskQueue}/retirement`, `GET /api/deployments/{name}/retirement` | `dw task-queue:retirement` | — | +| Retirar | `POST /api/task-queues/{taskQueue}/retire`, `POST /api/deployments/{name}/retire` | `dw task-queue:retire` | — | -Estas mutaciones aceptan `{"build_id":"orders-v2"}` o `{"build_id":null}` para la cohorte sin versión. Los comandos CLI usan `--build-id` o `--unversioned`, nunca ambos. +Las rutas de promoción, drenaje y reanudación aceptan `{"build_id":"orders-v2"}` o `{"build_id":null}` para la cohorte sin versión. Las rutas de retirada aceptan un cuerpo opcional `{"expected_inventory_revision":"..."}`. Los comandos CLI usan `--build-id` o `--unversioned`, nunca ambos. Para el ciclo completo usa `GET /api/deployments` y `POST /api/deployments/{name}/{promote,drain,resume,rollback}`. Usa el nombre devuelto, por ejemplo `orders-prod/orders-critical@orders-v2`, con su namespace original. En la ruta Apache publicada, conserva la barra separadora: codificar el nombre compuesto completo puede producir una HTML404 de Apache antes de llegar a la API. Las acciones rechazadas devuelven HTTP409 con `reason` tipado y un array `blockages`. Revisa `expected_resolution`; un rechazo no es una promoción correcta. [Server #521](https://github.com/durable-workflow/server/issues/521) sigue el espejo OpenAPI actual incompleto, no una implementación nueva ni un cambio de esquemas congelados. diff --git a/i18n/es/docusaurus-plugin-content-docs/current/polyglot/worker-compatibility-routing.md b/i18n/es/docusaurus-plugin-content-docs/current/polyglot/worker-compatibility-routing.md index aab8654290e..1f7a5e5c8ae 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/polyglot/worker-compatibility-routing.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/polyglot/worker-compatibility-routing.md @@ -73,8 +73,9 @@ El primer valor fija nuevas ejecuciones embebidas; el segundo permite reclamar e 3. Conserva capacidad compatible para ejecuciones fijadas, incluidas las que esperan pasivamente temporizador, señal, actividad o hijo. 4. Drena solo para detener deliberadamente las nuevas reclamaciones de la cohorte. Si se bloquea trabajo por un drenaje temprano, reanuda y restaura la compilación original compatible. 5. Para revertir nuevos inicios, restaura/reanuda y promueve la cohorte correcta; después revierte el despliegue defectuoso. Las fijaciones existentes no cambian. +6. Inspecciona el inventario de retirada de la compilación antigua y retírala con la [acción de retirada protegida](/docs/polyglot/worker-build-id-rollout#retire-a-build-or-queue) antes de detener sus workers. -Cero tareas pendientes no demuestra retirada segura. Conserva artefacto y recuperación mientras una ejecución fijada o una cadena heredada pueda necesitarlos. [Server #519](https://github.com/durable-workflow/server/issues/519) sigue esa función protegida separada; esta lista no la entrega. +Cero tareas pendientes no demuestra retirada segura. Native Server 3.14.0 y posteriores cuentan las ejecuciones fijadas, reintentos diferidos, temporizadores, actividades, validaciones de actualización y programaciones que aún dependen de una compilación o cola, y rechazan retirarla con HTTP409 mientras quede alguna. ## Estado explícito de worker ausente {#explicit-missing-worker-state} @@ -82,7 +83,7 @@ Inspecciona conjuntamente las [tareas pendientes por cohorte](/docs/polyglot/wor ## Relación con despliegues por compilación {#how-this-relates-to-build-id-rollouts} -El estado del despliegue describe capacidad registrada e intenciones de nuevos inicios/ciclo de vida; la compatibilidad determina si se puede reclamar una tarea original concreta. Usa ambos. Ni drenaje ni reversión reescriben compatibilidad duradera ni demuestran que se pueda eliminar una compilación. +El estado del despliegue describe capacidad registrada e intenciones de nuevos inicios/ciclo de vida; la compatibilidad determina si se puede reclamar una tarea original concreta. Usa ambos. Ni drenaje ni reversión reescriben compatibilidad duradera ni demuestran que se pueda eliminar una compilación; eso lo decide el inventario de retirada protegida. ## Referencias relacionadas {#related-references} diff --git a/i18n/es/source-hashes.json b/i18n/es/source-hashes.json index 9a91b96e8f1..235b9dcc593 100644 --- a/i18n/es/source-hashes.json +++ b/i18n/es/source-hashes.json @@ -98,8 +98,8 @@ "polyglot/task-matching-dispatch.md": "9c8ffbbee16b5da48e7882721d7ba8eac209a374a6ca766d93d2b17e825b203d", "polyglot/task-queue-admission.md": "efcf934876a27c153dd3ecd1a995e7c08b37452c79dfcbba1ae7fa0a8cbad327", "polyglot/visibility-query-language.md": "15790074c904c6cdbb1de8dfade95ea9ca6391f2f16412db517a2fb84ef08334", - "polyglot/worker-build-id-rollout.md": "da8d837abf5d3aea049b1cd9d2ec906afd0f5f32e7340f459f1aaf664c6c6b5a", - "polyglot/worker-compatibility-routing.md": "ef58f23c112f0e6b968927ba861177903adca21ed33b6b9371681e23a18b2994", + "polyglot/worker-build-id-rollout.md": "822de3400c55367511c69de02f540845a9569e7d8be63bcf062f938a9acfeb82", + "polyglot/worker-compatibility-routing.md": "b05150fe1e18ff6dcc6e8047bd445f5ef3522540f2102981d89c65e45770bb69", "polyglot/worker-protocol.md": "91b18b39d626c1288bfa3f6b8212fa8246aa14393cb489a39fe90379bc4cd4b2", "polyglot/workflow-signals.md": "cfef2937ff4052ebd00494cdec522ef9c830d58389dfd249342d667d5c583839", "polyglot/workflow-streams.md": "5675a8ea1b9d0b1f7223fecb90b3b048d3006670bf505950bc783709287a6432", diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/polyglot/worker-build-id-rollout.md b/i18n/fr/docusaurus-plugin-content-docs/current/polyglot/worker-build-id-rollout.md index 0fc89524c1d..dd5bac0a482 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current/polyglot/worker-build-id-rollout.md +++ b/i18n/fr/docusaurus-plugin-content-docs/current/polyglot/worker-build-id-rollout.md @@ -12,7 +12,7 @@ keywords: [build des workers, drainage, retour arrière, canary, workers sans ve Avant de promouvoir un candidat, relisez des historiques représentatifs ouverts et récemment clôturés avec son code applicatif exact. Avant un retour arrière, relisez les historiques écrits par le nouveau build avec l’ancien artefact. Suivez le [contrôle de relecture](../testing.md#replay-before-deployment) : une cohorte de routage compatible ou une vérification d’intégrité réussie ne prouve pas à elle seule la compatibilité de relecture. -Inspectez les cohortes, choisissez le build des nouveaux workflows et conservez des workers compatibles pour les exécutions existantes. La promotion change la sélection des nouveaux démarrages. Le drainage empêche de nouvelles prises de tâches par la cohorte. Aucune de ces opérations ne migre les exécutions ni ne prouve qu'un build peut être supprimé. +Inspectez les cohortes, choisissez le build des nouveaux workflows et conservez des workers compatibles pour les exécutions existantes. La promotion change la sélection des nouveaux démarrages. Le drainage empêche de nouvelles prises de tâches par la cohorte. Aucune de ces opérations ne migre les exécutions ni ne prouve qu'un build peut être supprimé ; c'est le [retrait protégé](#retire-a-build-or-queue) qui en décide. [Compatibilité et routage des workers](/docs/polyglot/worker-compatibility-routing) décrit l'identité portée par les tâches, activités, reprises, enfants et continue-as-new. Une cohorte est délimitée par `(namespace, task_queue, build_id)`. Sans `build_id`, une inscription appartient à la cohorte non versionnée `null`. @@ -78,9 +78,9 @@ La cohorte non versionnée ne reçoit pas ce diagnostic propre au build. Un cham Un ancien build peut avoir deux tâches prêtes et une louée, tandis que le nouveau n'en a aucune. Un total de trois pour la file ne désigne pas la flotte à renforcer. Sans worker actif de l'ancien build, restaurez sa capacité compatible ou reprenez-le si son drainage était accidentel. Des workers du nouveau build ne consomment pas les tâches épinglées à l'ancien. Si seules des inscriptions périmées subsistent, recherchez les processus ou heartbeats perdus avant de les compter comme capacité disponible. -Réduisez une cohorte prudemment après examen de ses tâches, inscriptions récentes, types de workflow, places disponibles et intention de drainage. Conservez de la capacité pour les baux et les futures tâches des exécutions existantes. Une exécution attendant signal, timer, activité ou enfant peut n'avoir aucune tâche de workflow maintenant et nécessiter l'ancien build plus tard. Les activités peuvent utiliser d'autres files enregistrées. Cet endpoint n'autorise ni la suppression sûre du build ni la réduction à zéro de la dernière cohorte nécessaire. +Réduisez une cohorte prudemment après examen de ses tâches, inscriptions récentes, types de workflow, places disponibles et intention de drainage. Conservez de la capacité pour les baux et les futures tâches des exécutions existantes. Une exécution attendant signal, timer, activité ou enfant peut n'avoir aucune tâche de workflow maintenant et nécessiter l'ancien build plus tard. Les activités peuvent utiliser d'autres files enregistrées. Cet endpoint n'autorise ni la suppression sûre du build ni la réduction à zéro de la dernière cohorte nécessaire ; utilisez pour cela le [retrait protégé](#retire-a-build-or-queue). -[Server #519](https://github.com/durable-workflow/server/issues/519) suit la décision protégée de retrait ; [Server #534](https://github.com/durable-workflow/server/issues/534), la capacité distincte de collecte et de réduction à zéro. Cette checklist ne les livre pas et ne documente aucun déclencheur KEDA/HPA intégré. +[Server #534](https://github.com/durable-workflow/server/issues/534) suit la capacité distincte de collecte et de réduction à zéro. Aucun déclencheur KEDA/HPA intégré n'est documenté ici. ## Première transition du non versionné au versionné {#first-cutover-unversioned-to-versioned} @@ -93,7 +93,7 @@ Réduisez une cohorte prudemment après examen de ses tâches, inscriptions réc ``` 4. Gardez les workers compatibles avec les historiques existants. La promotion ne modifie pas les anciens épinglages ; drainer n'est pas migrer. -5. Retirez l'ancienne capacité seulement après résolution indépendante de ses dépendances restantes. Des compteurs vides et zéro inscription ne suffisent pas. Conservez l'artefact et la voie de récupération tant qu'une exécution peut en dépendre. +5. Retirez l'ancien build avec le [retrait protégé](#retire-a-build-or-queue) dès que son inventaire est vide. Des compteurs vides et zéro inscription ne le prouvent pas. Conservez l'artefact tant qu'une exécution peut en dépendre. ## Tester un nouveau build en canary {#canary-a-new-build} @@ -123,7 +123,53 @@ Ne drainez pas simplement parce que le nouveau build sait prendre son propre tra dw task-queue:resume orders-critical --namespace orders-prod --build-id orders-v1 ``` -Drainer ou arrêter tous les workers ne prouve pas que l'artefact est supprimable. Ce snapshot ne fournit aucune décision protégée de retrait. +Drainer ou arrêter tous les workers ne prouve pas que l'artefact est supprimable. Le drainage reste l'arrêt d'urgence : il refuse immédiatement les polls du build, qu'il reste ou non du travail épinglé dessus. Utilisez le [retrait protégé](#retire-a-build-or-queue) pour décider de sa suppression. + +## Retirer un build ou une file {#retire-a-build-or-queue} + +Native Server 3.14.0 et versions ultérieures indiquent si un build ou une file peut être supprimé sans risque, et refusent le retrait tant qu'une dépendance active subsiste. Exigez que `capabilities.worker_build_retirement` vaille exactement `true` dans `GET /api/cluster/info` ; le Server PHP publié ne sert pas ces routes. Utilisez un jeton opérateur ou administrateur et le namespace, comme pour les autres routes build-id. + +| Intention | Endpoint HTTP | +| --- | --- | +| Inspecter un build | `GET /api/deployments/{namespace}/{taskQueue}@{buildId}/retirement` (`@unversioned` pour la cohorte non versionnée) | +| Retirer un build | `POST /api/deployments/{namespace}/{taskQueue}@{buildId}/retire` | +| Inspecter toutes les cohortes d'une file | `GET /api/task-queues/{taskQueue}/retirement` | +| Retirer une file | `POST /api/task-queues/{taskQueue}/retire` | + +1. Promouvez le build de remplacement et laissez tourner les workers de l'ancien. Ils terminent les exécutions encore épinglées dessus, les reprises différées, les timers et les chaînes continuées. +2. Inspectez l'ancien build jusqu'à ce que `retirable` vaille `true` : + + ```bash + dw task-queue:retirement orders-critical --namespace orders-prod --build-id orders-v1 --json + ``` + + Chaque blocage donne son `count` exact, jusqu'à 20 identités d'exemple et une action `recovery` : laisser le travail se terminer, ou annuler ou terminer les exécutions que vous choisissez d'abandonner. +3. Retirez-le, éventuellement lié à l'`observation.inventory_revision` inspectée : + + ```bash + dw task-queue:retire orders-critical --namespace orders-prod --build-id orders-v1 \ + --expected-revision "$INVENTORY_REVISION" + ``` + +4. N'arrêtez les processus de l'ancien build qu'après la réussite du retrait. + +Sans `--build-id` ni `--unversioned`, les deux commandes portent sur toutes les cohortes de la file. Ces commandes arrivent dans la première version de la CLI après 2.11.0 ; avec la CLI 2.11.0 ou antérieure, appelez directement les routes HTTP. + +L'inventaire compte les exécutions ouvertes épinglées au build (y compris celles en attente, continuées et enfants), les tâches prêtes, louées et différées (reprises d'activité et timers pas encore échus), les activités ouvertes, les validations de mise à jour en attente et, pour une file, les planifications qui y démarrent des exécutions. Une exécution ouverte sans file de tâches enregistrée rend l'inventaire `incomplete`, et le retrait est indisponible. + +L'inspection n'est qu'un aperçu. Le retrait recompte dans la même transition sérialisée que les démarrages, les reprises et la création de tâches, et n'écrit que lorsqu'il ne reste rien. Un retrait refusé répond HTTP409 et ne change rien ; suivez `expected_resolution` puis inspectez de nouveau. + +| `reason` | Signification | +| --- | --- | +| `unknown_deployment`, `unknown_task_queue` | Aucun worker inscrit et aucun déploiement enregistré pour la cible. | +| `selected_for_new_starts` | Les nouveaux démarrages de la file sélectionnent encore ce build. Promouvez d'abord le remplaçant. | +| `inventory_incomplete` | Des exécutions ouvertes non attribuées existent. Un inventaire manquant n'autorise jamais un retrait. | +| `live_dependencies` | Au moins un blocage a un compteur non nul. | +| `inventory_changed` | L'`expected_inventory_revision` ne correspond plus. | + +Un retrait réussi renvoie HTTP200 avec `outcome: "retired"`, `retired_at` et `retired_by`. L'intention de déploiement du build passe à l'état terminal `drained` : il n'est plus jamais sélectionné pour les nouveaux démarrages, ne peut être ni promu ni repris via le cycle de vie du déploiement, et ses workers restent en drainage. Quand toutes les cohortes d'une file sont retirées et qu'aucun worker actif ne reste, les nouveaux démarrages y sont refusés avec `task_queue_draining` et `routing_status: "retired"` jusqu'à l'inscription d'une nouvelle cohorte active. Les pins d'exécution, files d'activités, historiques et échéances restent inchangés. + +Pour récupérer, `dw task-queue:resume` (`POST /api/task-queues/{taskQueue}/build-ids/resume`) remet un build retiré à `active` ; le retrait garantissait qu'il n'avait aucun travail à ce moment-là. ## Revenir d'un build défectueux {#roll-back-a-bad-build} @@ -139,8 +185,10 @@ Les réessais, les exécutions enfants et le continue-as-new ordinaire héritent | Sélectionner les nouveaux démarrages | `POST /api/task-queues/{taskQueue}/build-ids/promote` | `dw task-queue:promote` | `Client.promote_task_queue_build_id` | | Drainer | `POST /api/task-queues/{taskQueue}/build-ids/drain` | `dw task-queue:drain` | `Client.drain_task_queue_build_id` | | Reprendre | `POST /api/task-queues/{taskQueue}/build-ids/resume` | `dw task-queue:resume` | `Client.resume_task_queue_build_id` | +| Inspecter le retrait | `GET /api/task-queues/{taskQueue}/retirement`, `GET /api/deployments/{name}/retirement` | `dw task-queue:retirement` | — | +| Retirer | `POST /api/task-queues/{taskQueue}/retire`, `POST /api/deployments/{name}/retire` | `dw task-queue:retire` | — | -Ces mutations acceptent `{"build_id":"orders-v2"}` ou `{"build_id":null}` pour la cohorte non versionnée. Les commandes CLI choisissent soit `--build-id`, soit `--unversioned`, jamais les deux. +Les routes de promotion, de drainage et de reprise acceptent `{"build_id":"orders-v2"}` ou `{"build_id":null}` pour la cohorte non versionnée. Les routes de retrait acceptent un corps optionnel `{"expected_inventory_revision":"..."}`. Les commandes CLI choisissent soit `--build-id`, soit `--unversioned`, jamais les deux. Le cycle de vie complet utilise `GET /api/deployments` et `POST /api/deployments/{name}/{promote,drain,resume,rollback}`. Reprenez le nom retourné, par exemple `orders-prod/orders-critical@orders-v2`, et son namespace d'origine. Sur le chemin Apache publié, gardez le séparateur `/` du nom : encoder le nom composé entier peut produire une HTML404 Apache avant d'atteindre l'API. Une action refusée retourne HTTP409 avec un `reason` typé et un tableau `blockages`. Consultez `expected_resolution` ; un refus n'est pas une promotion réussie. [Server #521](https://github.com/durable-workflow/server/issues/521) concerne le miroir OpenAPI actuel incomplet, pas une nouvelle implémentation ni un changement des schémas figés. diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/polyglot/worker-compatibility-routing.md b/i18n/fr/docusaurus-plugin-content-docs/current/polyglot/worker-compatibility-routing.md index 8361cc0ed22..5d419cb1bfb 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current/polyglot/worker-compatibility-routing.md +++ b/i18n/fr/docusaurus-plugin-content-docs/current/polyglot/worker-compatibility-routing.md @@ -73,8 +73,9 @@ La première valeur épingle les nouveaux workflows embarqués ; la seconde auto 3. Conservez la capacité compatible des exécutions épinglées, y compris celles qui attendent passivement timer, signal, activité ou enfant. 4. Drainez uniquement pour arrêter volontairement les nouvelles prises de cette cohorte. Si cela bloque du travail, reprenez et restaurez le build compatible d'origine. 5. Pour revenir sur les nouveaux démarrages, restaurez/reprenez et promouvez la cohorte connue comme fonctionnelle, puis révoquez le mauvais déploiement. Les pins existants restent inchangés. +6. Inspectez l'inventaire de retrait de l'ancien build et retirez-le avec l'[action de retrait protégé](/docs/polyglot/worker-build-id-rollout#retire-a-build-or-queue) avant d'arrêter ses workers. -Zéro tâche de workflow en attente ne prouve pas un retrait sûr. Conservez l'artefact et la voie de récupération tant qu'une exécution épinglée ou une chaîne héritée peut en dépendre. [Server #519](https://github.com/durable-workflow/server/issues/519) suit cette capacité protégée distincte ; la checklist ne la livre pas. +Zéro tâche de workflow en attente ne prouve pas un retrait sûr. Native Server 3.14.0 et versions ultérieures comptent les exécutions épinglées, reprises différées, timers, activités, validations de mise à jour et planifications qui dépendent encore d'un build ou d'une file, et refusent le retrait avec HTTP409 tant qu'il en reste. ## État explicite de worker manquant {#explicit-missing-worker-state} @@ -82,7 +83,7 @@ Inspectez ensemble les [tâches en attente par cohorte](/docs/polyglot/worker-bu ## Lien avec les déploiements par build {#how-this-relates-to-build-id-rollouts} -L'état du déploiement décrit la capacité enregistrée et les intentions de nouveaux démarrages/cycle de vie ; la compatibilité détermine la prise d'une tâche d'origine précise. Utilisez les deux. Ni drainage ni rollback ne réécrit la compatibilité durable ou ne prouve qu'un build est supprimable. +L'état du déploiement décrit la capacité enregistrée et les intentions de nouveaux démarrages/cycle de vie ; la compatibilité détermine la prise d'une tâche d'origine précise. Utilisez les deux. Ni drainage ni rollback ne réécrit la compatibilité durable ou ne prouve qu'un build est supprimable ; c'est l'inventaire de retrait protégé qui en décide. ## Références associées {#related-references} diff --git a/i18n/fr/source-hashes.json b/i18n/fr/source-hashes.json index 9a91b96e8f1..235b9dcc593 100644 --- a/i18n/fr/source-hashes.json +++ b/i18n/fr/source-hashes.json @@ -98,8 +98,8 @@ "polyglot/task-matching-dispatch.md": "9c8ffbbee16b5da48e7882721d7ba8eac209a374a6ca766d93d2b17e825b203d", "polyglot/task-queue-admission.md": "efcf934876a27c153dd3ecd1a995e7c08b37452c79dfcbba1ae7fa0a8cbad327", "polyglot/visibility-query-language.md": "15790074c904c6cdbb1de8dfade95ea9ca6391f2f16412db517a2fb84ef08334", - "polyglot/worker-build-id-rollout.md": "da8d837abf5d3aea049b1cd9d2ec906afd0f5f32e7340f459f1aaf664c6c6b5a", - "polyglot/worker-compatibility-routing.md": "ef58f23c112f0e6b968927ba861177903adca21ed33b6b9371681e23a18b2994", + "polyglot/worker-build-id-rollout.md": "822de3400c55367511c69de02f540845a9569e7d8be63bcf062f938a9acfeb82", + "polyglot/worker-compatibility-routing.md": "b05150fe1e18ff6dcc6e8047bd445f5ef3522540f2102981d89c65e45770bb69", "polyglot/worker-protocol.md": "91b18b39d626c1288bfa3f6b8212fa8246aa14393cb489a39fe90379bc4cd4b2", "polyglot/workflow-signals.md": "cfef2937ff4052ebd00494cdec522ef9c830d58389dfd249342d667d5c583839", "polyglot/workflow-streams.md": "5675a8ea1b9d0b1f7223fecb90b3b048d3006670bf505950bc783709287a6432", diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/polyglot/worker-build-id-rollout.md b/i18n/ja/docusaurus-plugin-content-docs/current/polyglot/worker-build-id-rollout.md index bcc04521bbc..8d0e152e733 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/polyglot/worker-build-id-rollout.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/polyglot/worker-build-id-rollout.md @@ -12,7 +12,7 @@ keywords: [ワーカービルド, ドレイン, ロールバック, カナリア 候補を昇格する前に、代表的な実行中および最近終了した履歴を、その候補の正確なアプリケーションコードでリプレイします。ロールバック前には、新しいビルドが書き込んだ履歴を古いアーティファクトでリプレイしてください。[リプレイの判定](../testing.md#replay-before-deployment)に従います。ルーティング先の互換コホートや整合性確認の成功だけでは、リプレイ互換性を証明できません。 -このガイドでは、コホートの確認、新規ワークフロー用ビルドの選択、既存実行に必要な互換ワーカーの維持を説明します。昇格は新規開始の選択を変更し、ドレインは対象コホートの新しいタスク取得を止めます。どちらも既存実行を移行せず、ビルドを削除できる根拠にもなりません。 +このガイドでは、コホートの確認、新規ワークフロー用ビルドの選択、既存実行に必要な互換ワーカーの維持を説明します。昇格は新規開始の選択を変更し、ドレインは対象コホートの新しいタスク取得を止めます。どちらも既存実行を移行せず、ビルドを削除できる根拠にもなりません。その判断は[保護された廃止](#retire-a-build-or-queue)で行います。 タスク、アクティビティ、再試行、子、continue-as-newが保持する識別情報は[ワーカーの互換性とルーティング](/docs/polyglot/worker-compatibility-routing)を参照してください。コホートの範囲は`(namespace, task_queue, build_id)`です。`build_id`のない登録は、バージョンなしの`null`コホートに属します。 @@ -78,9 +78,9 @@ async with Client("https://durable-workflow.example", token=operator_token, 例えば旧ビルドにreadyが2件、leasedが1件あり、新ビルドには0件の場合があります。キュー合計3件だけでは、どちらのフリートに処理能力が必要か分かりません。旧ビルドのアクティブワーカーが0なら、互換ワーカーを復旧するか、誤ったドレインを明示的に解除します。新ビルドの増員では旧ピンの仕事を消費できません。古い登録しか残らない場合は、利用可能と数える前にプロセスやheartbeatの喪失を調べてください。 -コホートを縮小する際は、個別のタスク数、最新ワーカー、宣言型、空きスロット、ドレイン意図を確認します。既存リースと既存実行から将来生じる仕事の処理能力を残してください。シグナル、タイマー、アクティビティ、子を待つ実行は、今のワークフロータスクが0でも後で旧ビルドを必要とします。アクティビティは別の保存済みキューを使う場合もあります。このエンドポイントは、安全な廃止判断や、最後の必要コホートを0へ縮小する権限を提供しません。 +コホートを縮小する際は、個別のタスク数、最新ワーカー、宣言型、空きスロット、ドレイン意図を確認します。既存リースと既存実行から将来生じる仕事の処理能力を残してください。シグナル、タイマー、アクティビティ、子を待つ実行は、今のワークフロータスクが0でも後で旧ビルドを必要とします。アクティビティは別の保存済みキューを使う場合もあります。このエンドポイントは、安全な廃止判断や、最後の必要コホートを0へ縮小する権限を提供しません。その判断には[保護された廃止](#retire-a-build-or-queue)を使います。 -保護された廃止判断は[Server #519](https://github.com/durable-workflow/server/issues/519)、別途のスクレイプ/ゼロスケール機能は[Server #534](https://github.com/durable-workflow/server/issues/534)で追跡します。このチェックリストで提供される機能ではなく、組み込みのKEDA/HPAトリガーもここでは規定しません。 +別途のスクレイプ/ゼロスケール機能は[Server #534](https://github.com/durable-workflow/server/issues/534)で追跡します。組み込みのKEDA/HPAトリガーはここでは規定しません。 ## バージョンなしからの初回切り替え {#first-cutover-unversioned-to-versioned} @@ -93,7 +93,7 @@ async with Client("https://durable-workflow.example", token=operator_token, ``` 4. 既存履歴に対応するワーカーを維持します。昇格は旧ピンを変えず、ドレインも移行ではありません。 -5. 残存依存関係を独立に解消してから旧処理能力を廃止します。タスク0件や登録0件だけでは不十分です。必要な実行がある限り、成果物と復旧経路を維持してください。 +5. 旧ビルドのインベントリが空になったら、[保護された廃止](#retire-a-build-or-queue)で廃止します。タスク0件や登録0件だけでは証拠になりません。必要な実行がある限り、ビルド成果物を維持してください。 ## 新ビルドのカナリア運用 {#canary-a-new-build} @@ -123,7 +123,53 @@ dw task-queue:drain orders-critical --namespace orders-prod --build-id orders-v1 dw task-queue:resume orders-critical --namespace orders-prod --build-id orders-v1 ``` -全ワーカーのドレインや停止は、ビルド成果物を削除できる証拠ではありません。このスナップショットには保護された廃止判断はありません。 +全ワーカーのドレインや停止は、ビルド成果物を削除できる証拠ではありません。ドレインは引き続き緊急停止手段であり、ビルドに固定された作業が残っているかどうかにかかわらず、そのビルドのポーリングを即座に拒否します。削除の判断には[保護された廃止](#retire-a-build-or-queue)を使ってください。 + +## ビルドまたはキューを廃止する {#retire-a-build-or-queue} + +Native Server 3.14.0以降は、ビルドやキューを安全に削除できるかを判定し、稼働中の依存関係が残っている間は廃止を拒否します。`GET /api/cluster/info`の`capabilities.worker_build_retirement`が厳密に`true`であることを確認してください。公開済みのPHP Serverはこれらのルートを提供しません。他のビルドIDルートと同様に、オペレーターまたは管理者トークンと名前空間を使います。 + +| 目的 | HTTPエンドポイント | +| --- | --- | +| 1つのビルドを確認 | `GET /api/deployments/{namespace}/{taskQueue}@{buildId}/retirement` (バージョンなしコホートは`@unversioned`) | +| 1つのビルドを廃止 | `POST /api/deployments/{namespace}/{taskQueue}@{buildId}/retire` | +| キューの全コホートを確認 | `GET /api/task-queues/{taskQueue}/retirement` | +| キューを廃止 | `POST /api/task-queues/{taskQueue}/retire` | + +1. 置き換え先のビルドを昇格し、旧ビルドのワーカーは動かし続けます。旧ワーカーは、まだ旧ビルドに固定されている実行、遅延中のリトライ、タイマー、継続されたチェーンを完了させます。 +2. `retirable`が`true`になるまで旧ビルドを確認します。 + + ```bash + dw task-queue:retirement orders-critical --namespace orders-prod --build-id orders-v1 --json + ``` + + 各ブロッカーは正確な`count`、最大20件のサンプルID、`recovery`アクションを示します。作業の完了を待つか、放棄すると決めた実行をキャンセルまたは強制終了してください。 +3. 必要に応じて確認時の`observation.inventory_revision`に紐付けて廃止します。 + + ```bash + dw task-queue:retire orders-critical --namespace orders-prod --build-id orders-v1 \ + --expected-revision "$INVENTORY_REVISION" + ``` + +4. 廃止が成功してから旧ビルドのプロセスを停止します。 + +`--build-id`も`--unversioned`も指定しない場合、両コマンドはキューの全コホートを対象にします。これらのコマンドは2.11.0の次のCLIリリースで提供されます。CLI 2.11.0以前ではHTTPルートを直接呼び出してください。 + +インベントリは、ビルドに固定された未完了の実行(待機中、継続済み、子の実行を含む)、準備完了・リース中・遅延中のタスク(期限前のアクティビティリトライとタイマー)、未完了のアクティビティ、保留中の更新検証、そしてキューの場合はそのキューで実行を開始するスケジュールを数えます。タスクキューが記録されていない未完了の実行があるとインベントリは`incomplete`となり、廃止はできません。 + +確認はプレビューです。廃止アクションは、開始、リトライ、タスク作成と同じ直列化された遷移の中で再度数え、何も残っていない場合にだけ書き込みます。拒否された廃止はHTTP409を返し、何も変更しません。`expected_resolution`に従ってから再確認してください。 + +| `reason` | 意味 | +| --- | --- | +| `unknown_deployment`, `unknown_task_queue` | 対象に登録済みワーカーも記録済みロールアウトもありません。 | +| `selected_for_new_starts` | キューの新規開始がまだこのビルドを選択しています。先に置き換え先を昇格してください。 | +| `inventory_incomplete` | 帰属先のない未完了の実行があります。インベントリの欠落は廃止の許可になりません。 | +| `live_dependencies` | 少なくとも1つのブロッカーが0以外の件数です。 | +| `inventory_changed` | `expected_inventory_revision`が一致しなくなりました。 | + +廃止が成功するとHTTP200と`outcome: "retired"`、`retired_at`、`retired_by`が返ります。ビルドのロールアウト意図は終端状態`drained`になります。新規開始に選ばれることはなく、デプロイのライフサイクルで昇格や再開もできず、ワーカーはドレイン状態のままです。キューの全コホートが廃止され、アクティブなワーカーが残っていない場合、新しいアクティブコホートが登録されるまで、そのキューでの新規開始は`task_queue_draining`と`routing_status: "retired"`で拒否されます。実行のピン、アクティビティキュー、履歴、期限は変わりません。 + +復旧するには、`dw task-queue:resume`(`POST /api/task-queues/{taskQueue}/build-ids/resume`)で廃止済みビルドを`active`に戻します。廃止時点でそのビルドに作業がなかったことは保証されています。 ## 不良ビルドをロールバックする {#roll-back-a-bad-build} @@ -139,8 +185,10 @@ dw task-queue:resume orders-critical --namespace orders-prod --build-id orders-v | 新規開始用の昇格 | `POST /api/task-queues/{taskQueue}/build-ids/promote` | `dw task-queue:promote` | `Client.promote_task_queue_build_id` | | ドレイン | `POST /api/task-queues/{taskQueue}/build-ids/drain` | `dw task-queue:drain` | `Client.drain_task_queue_build_id` | | 再開 | `POST /api/task-queues/{taskQueue}/build-ids/resume` | `dw task-queue:resume` | `Client.resume_task_queue_build_id` | +| 廃止可否の確認 | `GET /api/task-queues/{taskQueue}/retirement`, `GET /api/deployments/{name}/retirement` | `dw task-queue:retirement` | — | +| 廃止 | `POST /api/task-queues/{taskQueue}/retire`, `POST /api/deployments/{name}/retire` | `dw task-queue:retire` | — | -変更要求は`{"build_id":"orders-v2"}`、またはバージョンなしコホート用の`{"build_id":null}`を受け取ります。CLIでは`--build-id`と`--unversioned`のどちらか一方だけを指定します。 +昇格、ドレイン、再開のルートは`{"build_id":"orders-v2"}`、またはバージョンなしコホート用の`{"build_id":null}`を受け取ります。廃止ルートは省略可能な`{"expected_inventory_revision":"..."}`本文を受け取ります。CLIでは`--build-id`と`--unversioned`のどちらか一方だけを指定します。 完全なライフサイクルには`GET /api/deployments`と`POST /api/deployments/{name}/{promote,drain,resume,rollback}`を使います。返された`orders-prod/orders-critical@orders-v2`のような名前と元の名前空間を使用してください。公開Apache経路では名前の区切りの`/`を保持します。複合名全体を符号化すると、API到達前にApacheのHTML404になる場合があります。拒否は型付き`reason`と`blockages`配列を含むHTTP409です。`expected_resolution`を確認し、拒否を昇格成功として扱わないでください。[Server #521](https://github.com/durable-workflow/server/issues/521)は不完全な現行OpenAPIミラーの課題であり、新実装や凍結スキーマの変更ではありません。 diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/polyglot/worker-compatibility-routing.md b/i18n/ja/docusaurus-plugin-content-docs/current/polyglot/worker-compatibility-routing.md index 04746e68cb2..5c835d5d370 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/polyglot/worker-compatibility-routing.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/polyglot/worker-compatibility-routing.md @@ -73,8 +73,9 @@ DW_V2_SUPPORTED_COMPATIBILITIES=orders-2026-04-28,orders-2026-04-21 3. 固定された実行の互換容量を保ちます。タイマー、シグナル、アクティビティ、子を待つ受動的な実行も含みます。 4. そのコホートの新規取得を意図的に止めるときだけドレインします。早すぎるドレインで停止したら、再開して元の互換ビルドを復旧します。 5. 新規開始を戻すには、既知の正常コホートを復旧/再開して昇格し、その後不良デプロイをロールバックします。既存ピンは変わりません。 +6. 旧ビルドのワーカーを停止する前に、廃止インベントリを確認し、[保護された廃止アクション](/docs/polyglot/worker-build-id-rollout#retire-a-build-or-queue)で廃止します。 -未完了タスク0件は安全な廃止の証拠ではありません。固定実行や継承されたチェーンが必要とする間は成果物と復旧経路を残します。別途の保護された廃止機能は[Server #519](https://github.com/durable-workflow/server/issues/519)で追跡しており、この手順が提供するものではありません。 +未完了タスク0件は安全な廃止の証拠ではありません。Native Server 3.14.0以降は、ビルドやキューにまだ依存している固定実行、遅延リトライ、タイマー、アクティビティ、更新検証、スケジュールを数え、残っている間はHTTP409で廃止を拒否します。 ## 互換ワーカー不在の明示状態 {#explicit-missing-worker-state} @@ -82,7 +83,7 @@ DW_V2_SUPPORTED_COMPATIBILITIES=orders-2026-04-28,orders-2026-04-21 ## ビルドIDロールアウトとの関係 {#how-this-relates-to-build-id-rollouts} -ロールアウト状態は登録容量と新規開始/ライフサイクルの意図を示し、互換性は特定の元タスクを取得できるかを決めます。両方を使ってください。ドレインもロールバックも永続互換性を書き換えず、ビルドを削除できる証明にはなりません。 +ロールアウト状態は登録容量と新規開始/ライフサイクルの意図を示し、互換性は特定の元タスクを取得できるかを決めます。両方を使ってください。ドレインもロールバックも永続互換性を書き換えず、ビルドを削除できる証明にはなりません。その判断は保護された廃止のインベントリが行います。 ## 関連資料 {#related-references} diff --git a/i18n/ja/source-hashes.json b/i18n/ja/source-hashes.json index 9a91b96e8f1..235b9dcc593 100644 --- a/i18n/ja/source-hashes.json +++ b/i18n/ja/source-hashes.json @@ -98,8 +98,8 @@ "polyglot/task-matching-dispatch.md": "9c8ffbbee16b5da48e7882721d7ba8eac209a374a6ca766d93d2b17e825b203d", "polyglot/task-queue-admission.md": "efcf934876a27c153dd3ecd1a995e7c08b37452c79dfcbba1ae7fa0a8cbad327", "polyglot/visibility-query-language.md": "15790074c904c6cdbb1de8dfade95ea9ca6391f2f16412db517a2fb84ef08334", - "polyglot/worker-build-id-rollout.md": "da8d837abf5d3aea049b1cd9d2ec906afd0f5f32e7340f459f1aaf664c6c6b5a", - "polyglot/worker-compatibility-routing.md": "ef58f23c112f0e6b968927ba861177903adca21ed33b6b9371681e23a18b2994", + "polyglot/worker-build-id-rollout.md": "822de3400c55367511c69de02f540845a9569e7d8be63bcf062f938a9acfeb82", + "polyglot/worker-compatibility-routing.md": "b05150fe1e18ff6dcc6e8047bd445f5ef3522540f2102981d89c65e45770bb69", "polyglot/worker-protocol.md": "91b18b39d626c1288bfa3f6b8212fa8246aa14393cb489a39fe90379bc4cd4b2", "polyglot/workflow-signals.md": "cfef2937ff4052ebd00494cdec522ef9c830d58389dfd249342d667d5c583839", "polyglot/workflow-streams.md": "5675a8ea1b9d0b1f7223fecb90b3b048d3006670bf505950bc783709287a6432", diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/polyglot/worker-build-id-rollout.md b/i18n/pt-BR/docusaurus-plugin-content-docs/current/polyglot/worker-build-id-rollout.md index 549d6391357..e350686106a 100644 --- a/i18n/pt-BR/docusaurus-plugin-content-docs/current/polyglot/worker-build-id-rollout.md +++ b/i18n/pt-BR/docusaurus-plugin-content-docs/current/polyglot/worker-build-id-rollout.md @@ -12,7 +12,7 @@ keywords: [build dos workers, drenagem, reversão, canário, workers sem versão Antes de promover um candidato, reproduza históricos representativos abertos e encerrados recentemente usando seu código exato. Antes de reverter, reproduza os históricos escritos pelo build novo com o artefato antigo. Siga a [verificação de replay](../testing.md#replay-before-deployment); uma coorte de roteamento compatível ou uma verificação de integridade aprovada não comprova, por si só, compatibilidade de replay. -Use este guia para inspecionar coortes, escolher o build de novos workflows e manter workers compatíveis com execuções existentes. A promoção muda a seleção de novas inicializações; a drenagem impede novas reivindicações pela coorte. Nenhuma das ações migra execuções ou comprova que um build pode ser excluído. +Use este guia para inspecionar coortes, escolher o build de novos workflows e manter workers compatíveis com execuções existentes. A promoção muda a seleção de novas inicializações; a drenagem impede novas reivindicações pela coorte. Nenhuma das ações migra execuções ou comprova que um build pode ser excluído; essa decisão cabe à [retirada protegida](#retire-a-build-or-queue). [Compatibilidade e roteamento dos workers](/docs/polyglot/worker-compatibility-routing) descreve a identidade de tarefas, atividades, novas tentativas, filhos e continue-as-new. Uma coorte tem escopo `(namespace, task_queue, build_id)`. Registros sem `build_id` pertencem à coorte não versionada, `null`. @@ -78,9 +78,9 @@ A coorte não versionada não recebe esse diagnóstico específico de build. Cam Um build antigo pode ter duas tarefas prontas e uma concedida, enquanto o novo não tem pendências. Um total de três na fila não identifica qual frota precisa de capacidade. Se não há workers ativos do build antigo, restaure sua capacidade compatível ou retome-o se a drenagem foi acidental. Acrescentar workers novos não consome trabalho fixado ao antigo. Se restam apenas registros desatualizados, investigue processos ou heartbeats perdidos antes de contá-los como capacidade disponível. -Reduza cada coorte com cautela, conferindo suas tarefas, workers recentes, tipos declarados, vagas e intenção de drenagem. Mantenha capacidade para concessões e trabalho futuro de execuções existentes. Uma execução esperando sinal, timer, atividade ou filho pode não ter tarefa de workflow agora e precisar do build antigo depois. Atividades podem usar outras filas registradas. Este endpoint não determina retirada segura nem autoriza reduzir a zero a última coorte necessária. +Reduza cada coorte com cautela, conferindo suas tarefas, workers recentes, tipos declarados, vagas e intenção de drenagem. Mantenha capacidade para concessões e trabalho futuro de execuções existentes. Uma execução esperando sinal, timer, atividade ou filho pode não ter tarefa de workflow agora e precisar do build antigo depois. Atividades podem usar outras filas registradas. Este endpoint não determina retirada segura nem autoriza reduzir a zero a última coorte necessária; para isso, use a [retirada protegida](#retire-a-build-or-queue). -[Server #519](https://github.com/durable-workflow/server/issues/519) acompanha a decisão protegida de retirada; [Server #534](https://github.com/durable-workflow/server/issues/534), a capacidade separada de coleta e redução a zero. Esta lista não entrega essas funções nem documenta gatilho KEDA/HPA integrado. +[Server #534](https://github.com/durable-workflow/server/issues/534) acompanha a capacidade separada de coleta e redução a zero. Nenhum gatilho KEDA/HPA integrado é documentado aqui. ## Primeira transição do não versionado ao versionado {#first-cutover-unversioned-to-versioned} @@ -93,7 +93,7 @@ Reduza cada coorte com cautela, conferindo suas tarefas, workers recentes, tipos ``` 4. Preserve workers compatíveis com os históricos existentes. Promoção não muda fixações antigas; drenagem não é migração. -5. Retire capacidade antiga somente após resolver independentemente suas dependências restantes. Contadores vazios e zero registros não bastam. Preserve o artefato e a recuperação enquanto uma execução puder precisar dele. +5. Retire o build antigo com a [retirada protegida](#retire-a-build-or-queue) quando seu inventário estiver vazio. Contadores vazios e zero registros não comprovam isso. Preserve o artefato enquanto uma execução puder precisar dele. ## Testar um build novo com canário {#canary-a-new-build} @@ -123,7 +123,53 @@ Não drene apenas porque o novo build consegue reivindicar o próprio trabalho: dw task-queue:resume orders-critical --namespace orders-prod --build-id orders-v1 ``` -Drenar ou parar todos os workers não comprova que o artefato pode ser excluído. Este snapshot não oferece decisão protegida de retirada. +Drenar ou parar todos os workers não comprova que o artefato pode ser excluído. A drenagem continua sendo a parada de emergência: ela recusa imediatamente os polls do build, haja ou não trabalho ainda fixado nele. Use a [retirada protegida](#retire-a-build-or-queue) para decidir a remoção. + +## Retirar um build ou uma fila {#retire-a-build-or-queue} + +O Native Server 3.14.0 e posteriores informam se um build ou uma fila pode ser removido com segurança e recusam a retirada enquanto restar alguma dependência viva. Exija que `capabilities.worker_build_retirement` seja exatamente `true` em `GET /api/cluster/info`; o Server PHP publicado não atende essas rotas. Use um token de operador ou administrador e o namespace, como nas demais rotas de build-id. + +| Intenção | Endpoint HTTP | +| --- | --- | +| Inspecionar um build | `GET /api/deployments/{namespace}/{taskQueue}@{buildId}/retirement` (`@unversioned` para a coorte não versionada) | +| Retirar um build | `POST /api/deployments/{namespace}/{taskQueue}@{buildId}/retire` | +| Inspecionar todas as coortes de uma fila | `GET /api/task-queues/{taskQueue}/retirement` | +| Retirar uma fila | `POST /api/task-queues/{taskQueue}/retire` | + +1. Promova o build substituto e mantenha os workers do build antigo em execução. Eles concluem as execuções ainda fixadas nele, as novas tentativas adiadas, os timers e as cadeias continuadas. +2. Inspecione o build antigo até que `retirable` seja `true`: + + ```bash + dw task-queue:retirement orders-critical --namespace orders-prod --build-id orders-v1 --json + ``` + + Cada bloqueio informa seu `count` exato, até 20 identidades de amostra e uma ação `recovery`: deixar o trabalho terminar ou cancelar ou encerrar as execuções que você decidir abandonar. +3. Retire-o, opcionalmente vinculado à `observation.inventory_revision` inspecionada: + + ```bash + dw task-queue:retire orders-critical --namespace orders-prod --build-id orders-v1 \ + --expected-revision "$INVENTORY_REVISION" + ``` + +4. Pare os processos do build antigo somente depois que a retirada for bem-sucedida. + +Sem `--build-id` nem `--unversioned`, os dois comandos atuam sobre todas as coortes da fila. Esses comandos chegam na primeira versão da CLI posterior à 2.11.0; com a CLI 2.11.0 ou anterior, chame as rotas HTTP diretamente. + +O inventário conta as execuções abertas fixadas no build (incluindo as em espera, continuadas e filhas), as tarefas prontas, concedidas e adiadas (novas tentativas de atividade e timers ainda não vencidos), as atividades abertas, as validações de atualização pendentes e, para uma fila, os agendamentos que iniciam execuções nela. Uma execução aberta sem fila de tarefas registrada deixa o inventário `incomplete`, e a retirada fica indisponível. + +A inspeção é uma prévia. A retirada conta novamente dentro da mesma transição serializada usada por inícios, novas tentativas e criação de tarefas, e só grava quando nada resta. Uma retirada recusada responde HTTP409 e não altera nada; siga `expected_resolution` e inspecione novamente. + +| `reason` | Significado | +| --- | --- | +| `unknown_deployment`, `unknown_task_queue` | Nenhum worker registrado e nenhuma implantação registrada para o alvo. | +| `selected_for_new_starts` | Novas inicializações na fila ainda selecionam este build. Promova o substituto primeiro. | +| `inventory_incomplete` | Existem execuções abertas não atribuídas. Inventário ausente nunca autoriza a retirada. | +| `live_dependencies` | Pelo menos um bloqueio tem contador diferente de zero. | +| `inventory_changed` | A `expected_inventory_revision` não corresponde mais. | + +Uma retirada bem-sucedida retorna HTTP200 com `outcome: "retired"`, `retired_at` e `retired_by`. A intenção de implantação do build passa ao estado terminal `drained`: ele nunca mais é selecionado para novas inicializações, não pode ser promovido nem retomado pelo ciclo de vida da implantação, e seus workers permanecem drenando. Quando todas as coortes de uma fila estão retiradas e não resta nenhum worker ativo, novas inicializações nela são recusadas com `task_queue_draining` e `routing_status: "retired"` até que uma nova coorte ativa se registre. Fixações de execução, filas de atividade, histórico e prazos não mudam. + +Para recuperar, `dw task-queue:resume` (`POST /api/task-queues/{taskQueue}/build-ids/resume`) devolve um build retirado ao estado `active`; a retirada garantiu que ele não tinha trabalho naquele momento. ## Reverter um build defeituoso {#roll-back-a-bad-build} @@ -139,8 +185,10 @@ Novas tentativas, execuções filhas e o continue-as-new comum herdam a fixaçã | Selecionar novas inicializações | `POST /api/task-queues/{taskQueue}/build-ids/promote` | `dw task-queue:promote` | `Client.promote_task_queue_build_id` | | Drenar | `POST /api/task-queues/{taskQueue}/build-ids/drain` | `dw task-queue:drain` | `Client.drain_task_queue_build_id` | | Retomar | `POST /api/task-queues/{taskQueue}/build-ids/resume` | `dw task-queue:resume` | `Client.resume_task_queue_build_id` | +| Inspecionar a retirada | `GET /api/task-queues/{taskQueue}/retirement`, `GET /api/deployments/{name}/retirement` | `dw task-queue:retirement` | — | +| Retirar | `POST /api/task-queues/{taskQueue}/retire`, `POST /api/deployments/{name}/retire` | `dw task-queue:retire` | — | -As mutações aceitam `{"build_id":"orders-v2"}` ou `{"build_id":null}` para a coorte não versionada. Comandos CLI usam `--build-id` ou `--unversioned`, nunca ambos. +As rotas de promoção, drenagem e retomada aceitam `{"build_id":"orders-v2"}` ou `{"build_id":null}` para a coorte não versionada. As rotas de retirada aceitam um corpo opcional `{"expected_inventory_revision":"..."}`. Comandos CLI usam `--build-id` ou `--unversioned`, nunca ambos. Para o ciclo completo, use `GET /api/deployments` e `POST /api/deployments/{name}/{promote,drain,resume,rollback}`. Use o nome retornado, como `orders-prod/orders-critical@orders-v2`, no namespace original. No caminho Apache publicado, preserve a barra separadora: codificar todo o nome composto pode gerar uma HTML404 do Apache antes de chegar à API. Ações recusadas retornam HTTP409 com `reason` tipado e array `blockages`. Examine `expected_resolution`; recusa não é promoção bem-sucedida. [Server #521](https://github.com/durable-workflow/server/issues/521) acompanha o espelho OpenAPI atual incompleto, não uma implementação nova nem mudança de esquemas congelados. diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/polyglot/worker-compatibility-routing.md b/i18n/pt-BR/docusaurus-plugin-content-docs/current/polyglot/worker-compatibility-routing.md index f6dbc5e19cb..27d7712bbea 100644 --- a/i18n/pt-BR/docusaurus-plugin-content-docs/current/polyglot/worker-compatibility-routing.md +++ b/i18n/pt-BR/docusaurus-plugin-content-docs/current/polyglot/worker-compatibility-routing.md @@ -73,8 +73,9 @@ O primeiro valor fixa novas execuções embutidas; o segundo permite reivindica 3. Preserve capacidade compatível para execuções fixadas, inclusive as que aguardam passivamente timer, sinal, atividade ou filho. 4. Drene apenas para impedir deliberadamente novas reivindicações da coorte. Se o trabalho parar por drenagem prematura, retome e restaure o build original compatível. 5. Para reverter novas inicializações, restaure/retome e promova a coorte correta; depois reverta a implantação defeituosa. As fixações existentes não mudam. +6. Inspecione o inventário de retirada do build antigo e retire-o com a [ação de retirada protegida](/docs/polyglot/worker-build-id-rollout#retire-a-build-or-queue) antes de parar seus workers. -Zero tarefas pendentes não comprova retirada segura. Preserve artefato e recuperação enquanto uma execução fixada ou cadeia herdada puder precisar deles. [Server #519](https://github.com/durable-workflow/server/issues/519) acompanha essa função protegida separada; esta lista não a entrega. +Zero tarefas pendentes não comprova retirada segura. O Native Server 3.14.0 e posteriores contam as execuções fixadas, novas tentativas adiadas, timers, atividades, validações de atualização e agendamentos que ainda dependem de um build ou fila, e recusam a retirada com HTTP409 enquanto restar algum. ## Estado explícito de worker ausente {#explicit-missing-worker-state} @@ -82,7 +83,7 @@ Inspecione conjuntamente [tarefas pendentes por coorte](/docs/polyglot/worker-bu ## Relação com implantações por build {#how-this-relates-to-build-id-rollouts} -O estado de implantação descreve capacidade registrada e intenções de novas inicializações/ciclo de vida; a compatibilidade determina a reivindicação de uma tarefa original específica. Use ambos. Nem drenagem nem reversão reescrevem compatibilidade durável ou provam que um build pode ser removido. +O estado de implantação descreve capacidade registrada e intenções de novas inicializações/ciclo de vida; a compatibilidade determina a reivindicação de uma tarefa original específica. Use ambos. Nem drenagem nem reversão reescrevem compatibilidade durável ou provam que um build pode ser removido; quem decide isso é o inventário de retirada protegida. ## Referências relacionadas {#related-references} diff --git a/i18n/pt-BR/source-hashes.json b/i18n/pt-BR/source-hashes.json index 9a91b96e8f1..235b9dcc593 100644 --- a/i18n/pt-BR/source-hashes.json +++ b/i18n/pt-BR/source-hashes.json @@ -98,8 +98,8 @@ "polyglot/task-matching-dispatch.md": "9c8ffbbee16b5da48e7882721d7ba8eac209a374a6ca766d93d2b17e825b203d", "polyglot/task-queue-admission.md": "efcf934876a27c153dd3ecd1a995e7c08b37452c79dfcbba1ae7fa0a8cbad327", "polyglot/visibility-query-language.md": "15790074c904c6cdbb1de8dfade95ea9ca6391f2f16412db517a2fb84ef08334", - "polyglot/worker-build-id-rollout.md": "da8d837abf5d3aea049b1cd9d2ec906afd0f5f32e7340f459f1aaf664c6c6b5a", - "polyglot/worker-compatibility-routing.md": "ef58f23c112f0e6b968927ba861177903adca21ed33b6b9371681e23a18b2994", + "polyglot/worker-build-id-rollout.md": "822de3400c55367511c69de02f540845a9569e7d8be63bcf062f938a9acfeb82", + "polyglot/worker-compatibility-routing.md": "b05150fe1e18ff6dcc6e8047bd445f5ef3522540f2102981d89c65e45770bb69", "polyglot/worker-protocol.md": "91b18b39d626c1288bfa3f6b8212fa8246aa14393cb489a39fe90379bc4cd4b2", "polyglot/workflow-signals.md": "cfef2937ff4052ebd00494cdec522ef9c830d58389dfd249342d667d5c583839", "polyglot/workflow-streams.md": "5675a8ea1b9d0b1f7223fecb90b3b048d3006670bf505950bc783709287a6432", diff --git a/i18n/uk/docusaurus-plugin-content-docs/current/polyglot/worker-build-id-rollout.md b/i18n/uk/docusaurus-plugin-content-docs/current/polyglot/worker-build-id-rollout.md index 44bce1fe63f..710dac6a07e 100644 --- a/i18n/uk/docusaurus-plugin-content-docs/current/polyglot/worker-build-id-rollout.md +++ b/i18n/uk/docusaurus-plugin-content-docs/current/polyglot/worker-build-id-rollout.md @@ -12,7 +12,7 @@ keywords: [збірки воркерів, дренування, відкат, к Перед promotion кандидата виконайте replay репрезентативних відкритих і нещодавно закритих історій на його точному коді застосунку. Перед відкатом перевірте історії новішого build на старішому артефакті. Дотримуйтесь [перевірки replay](../testing.md#replay-before-deployment); сумісна когорта маршрутизації чи успішна перевірка цілісності самі по собі не доводять replay-сумісність. -Цей посібник допомагає перевіряти когорти, обирати збірку для нових workflow та зберігати сумісних воркерів для наявних виконань. Просування змінює вибір для нових запусків; дренування забороняє когорті брати нові задачі. Жодна дія не переносить наявні виконання й не доводить, що збірку можна видалити. +Цей посібник допомагає перевіряти когорти, обирати збірку для нових workflow та зберігати сумісних воркерів для наявних виконань. Просування змінює вибір для нових запусків; дренування забороняє когорті брати нові задачі. Жодна дія не переносить наявні виконання й не доводить, що збірку можна видалити; це вирішує [захищене виведення з експлуатації](#retire-a-build-or-queue). [Сумісність і маршрутизація воркерів](/docs/polyglot/worker-compatibility-routing) пояснює ідентичність задач, активностей, повторів, дочірніх виконань і continue-as-new. Межі когорти — `(namespace, task_queue, build_id)`. Реєстрації без `build_id` належать до неверсіонованої когорти `null`. @@ -78,9 +78,9 @@ HTTP-знімок є першоджерелом для додаткових по Стара збірка може мати дві готові задачі й одну орендовану, а нова — жодної. Загальна кількість три не визначає, якій групі потрібна потужність. Якщо активних воркерів старої збірки немає, відновіть сумісну потужність або явно відновіть когорту після помилкового дренування. Нові воркери іншої збірки не забирають роботу зі старим закріпленням. Якщо залишилися лише застарілі реєстрації, спершу з'ясуйте долю процесів і heartbeat, а не рахуйте їх доступною потужністю. -Скорочуйте когорту обережно, перевіривши її задачі, свіжих воркерів, типи workflow, вільні слоти та намір дренування. Зберігайте потужність для орендованої та майбутньої роботи наявних виконань. Виконання, що чекає сигналу, таймера, активності чи дитини, зараз може не мати задачі workflow, але потребувати старої збірки пізніше. Активності можуть використовувати інші записані черги. Цей endpoint не визначає безпечного виведення з експлуатації й не дозволяє масштабувати останню потрібну когорту до нуля. +Скорочуйте когорту обережно, перевіривши її задачі, свіжих воркерів, типи workflow, вільні слоти та намір дренування. Зберігайте потужність для орендованої та майбутньої роботи наявних виконань. Виконання, що чекає сигналу, таймера, активності чи дитини, зараз може не мати задачі workflow, але потребувати старої збірки пізніше. Активності можуть використовувати інші записані черги. Цей endpoint не визначає безпечного виведення з експлуатації й не дозволяє масштабувати останню потрібну когорту до нуля; для цього використовуйте [захищене виведення з експлуатації](#retire-a-build-or-queue). -[Server #519](https://github.com/durable-workflow/server/issues/519) відстежує захищене рішення про виведення збірки; [Server #534](https://github.com/durable-workflow/server/issues/534) — окрему функцію збору показників і масштабування до нуля. Цей список їх не реалізує; вбудований тригер KEDA/HPA тут не задокументований. +[Server #534](https://github.com/durable-workflow/server/issues/534) відстежує окрему функцію збору показників і масштабування до нуля. Вбудований тригер KEDA/HPA тут не задокументований. ## Перший перехід до версіонованої збірки {#first-cutover-unversioned-to-versioned} @@ -93,7 +93,7 @@ HTTP-знімок є першоджерелом для додаткових по ``` 4. Збережіть воркерів, сумісних із наявними історіями. Просування не змінює старих закріплень, а дренування не є міграцією. -5. Прибирайте стару потужність лише після незалежного усунення решти залежностей. Порожні лічильники й нуль реєстрацій цього не доводять. Зберігайте артефакт і шлях відновлення, доки він може знадобитися виконанню. +5. Виведіть стару збірку з експлуатації через [захищене виведення](#retire-a-build-or-queue), щойно її інвентар стане порожнім. Порожні лічильники й нуль реєстрацій цього не доводять. Зберігайте артефакт, доки він може знадобитися виконанню. ## Канаркове розгортання нової збірки {#canary-a-new-build} @@ -123,7 +123,53 @@ dw task-queue:drain orders-critical --namespace orders-prod --build-id orders-v1 dw task-queue:resume orders-critical --namespace orders-prod --build-id orders-v1 ``` -Дренування чи зупинка всіх воркерів не доводить, що артефакт можна видалити. Знімок не містить захищеного рішення про виведення з експлуатації. +Дренування чи зупинка всіх воркерів не доводить, що артефакт можна видалити. Дренування залишається аварійною зупинкою: воно одразу відхиляє опитування збірки незалежно від того, чи закріплена за нею робота. Рішення про видалення ухвалюйте через [захищене виведення з експлуатації](#retire-a-build-or-queue). + +## Виведення збірки або черги з експлуатації {#retire-a-build-or-queue} + +Native Server 3.14.0 і новіші визначають, чи можна безпечно прибрати збірку або чергу, і відмовляють у виведенні з експлуатації, доки лишається будь-яка жива залежність. Вимагайте, щоб `capabilities.worker_build_retirement` у `GET /api/cluster/info` мало значення саме `true`; опублікований PHP Server цих маршрутів не обслуговує. Використовуйте токен оператора чи адміністратора та простір імен, як і для інших маршрутів build-id. + +| Намір | HTTP endpoint | +| --- | --- | +| Перевірити одну збірку | `GET /api/deployments/{namespace}/{taskQueue}@{buildId}/retirement` (`@unversioned` для неверсіонованої когорти) | +| Вивести одну збірку | `POST /api/deployments/{namespace}/{taskQueue}@{buildId}/retire` | +| Перевірити всі когорти черги | `GET /api/task-queues/{taskQueue}/retirement` | +| Вивести чергу | `POST /api/task-queues/{taskQueue}/retire` | + +1. Просуньте збірку-заміну й залиште воркери старої збірки працювати. Вони завершують виконання, що досі закріплені за нею, відкладені повтори, таймери та продовжені ланцюги. +2. Перевіряйте стару збірку, доки `retirable` не стане `true`: + + ```bash + dw task-queue:retirement orders-critical --namespace orders-prod --build-id orders-v1 --json + ``` + + Кожен блокер показує точний `count`, до 20 зразків ідентифікаторів і дію `recovery`: дати роботі завершитися або скасувати чи примусово завершити виконання, від яких ви вирішили відмовитися. +3. Виведіть її з експлуатації, за потреби прив’язавши запит до перевіреної `observation.inventory_revision`: + + ```bash + dw task-queue:retire orders-critical --namespace orders-prod --build-id orders-v1 \ + --expected-revision "$INVENTORY_REVISION" + ``` + +4. Зупиняйте процеси старої збірки лише після успішного виведення. + +Без `--build-id` чи `--unversioned` обидві команди діють на всі когорти черги. Ці команди з’являться в першому випуску CLI після 2.11.0; з CLI 2.11.0 або старішою викликайте HTTP-маршрути напряму. + +Інвентар рахує відкриті виконання, закріплені за збіркою (зокрема ті, що чекають, продовжені й дочірні), готові, орендовані та відкладені задачі (повтори активностей і таймери, строк яких ще не настав), відкриті активності, незавершені перевірки оновлень, а для черги — розклади, що запускають у ній виконання. Відкрите виконання без записаної черги задач робить інвентар `incomplete`, і виведення стає недоступним. + +Перевірка — лише попередній перегляд. Дія виведення рахує повторно в межах того самого серіалізованого переходу, який використовують запуски, повтори та створення задач, і записує зміни лише тоді, коли нічого не лишилося. Відхилене виведення повертає HTTP409 і нічого не змінює; дотримуйтесь `expected_resolution` і перевірте знову. + +| `reason` | Значення | +| --- | --- | +| `unknown_deployment`, `unknown_task_queue` | Для цілі не зареєстровано жодного воркера й не записано розгортання. | +| `selected_for_new_starts` | Нові запуски в черзі досі обирають цю збірку. Спершу просуньте заміну. | +| `inventory_incomplete` | Є відкриті виконання без прив’язки до черги. Відсутній інвентар ніколи не дає дозволу на виведення. | +| `live_dependencies` | Принаймні один блокер має ненульовий лічильник. | +| `inventory_changed` | `expected_inventory_revision` більше не збігається. | + +Успішне виведення повертає HTTP200 з `outcome: "retired"`, `retired_at` і `retired_by`. Намір розгортання збірки переходить у кінцевий стан `drained`: її більше ніколи не обирають для нових запусків, її не можна просунути чи відновити через життєвий цикл розгортання, а її воркери лишаються в дренуванні. Коли всі когорти черги виведено й активних воркерів не лишилося, нові запуски в ній відхиляються з `task_queue_draining` і `routing_status: "retired"`, доки не зареєструється нова активна когорта. Закріплення виконань, черги активностей, історія та строки не змінюються. + +Для відновлення `dw task-queue:resume` (`POST /api/task-queues/{taskQueue}/build-ids/resume`) повертає виведену збірку в стан `active`; виведення гарантувало, що на той момент у неї не було роботи. ## Відкат невдалої збірки {#roll-back-a-bad-build} @@ -139,8 +185,10 @@ dw task-queue:resume orders-critical --namespace orders-prod --build-id orders-v | Обрати нові запуски | `POST /api/task-queues/{taskQueue}/build-ids/promote` | `dw task-queue:promote` | `Client.promote_task_queue_build_id` | | Дренувати | `POST /api/task-queues/{taskQueue}/build-ids/drain` | `dw task-queue:drain` | `Client.drain_task_queue_build_id` | | Відновити | `POST /api/task-queues/{taskQueue}/build-ids/resume` | `dw task-queue:resume` | `Client.resume_task_queue_build_id` | +| Перевірити виведення | `GET /api/task-queues/{taskQueue}/retirement`, `GET /api/deployments/{name}/retirement` | `dw task-queue:retirement` | — | +| Вивести з експлуатації | `POST /api/task-queues/{taskQueue}/retire`, `POST /api/deployments/{name}/retire` | `dw task-queue:retire` | — | -Мутації приймають `{"build_id":"orders-v2"}` або `{"build_id":null}` для неверсіонованої когорти. CLI використовує `--build-id` або `--unversioned`, не обидва. +Маршрути promote, drain і resume приймають `{"build_id":"orders-v2"}` або `{"build_id":null}` для неверсіонованої когорти. Маршрути retire приймають необов’язкове тіло `{"expected_inventory_revision":"..."}`. CLI використовує `--build-id` або `--unversioned`, не обидва. Повний життєвий цикл доступний через `GET /api/deployments` і `POST /api/deployments/{name}/{promote,drain,resume,rollback}`. Використовуйте повернену назву, як-от `orders-prod/orders-critical@orders-v2`, і початковий простір імен. На опублікованому Apache-шляху зберігайте роздільний `/`: кодування всієї складеної назви може повернути Apache HTML404 ще до API. Відмови повертають HTTP409 із типізованим `reason` і масивом `blockages`. Перевірте `expected_resolution`; відмова не є успішним просуванням. [Server #521](https://github.com/durable-workflow/server/issues/521) стосується неповного поточного OpenAPI-дзеркала, а не нової реалізації чи зміни заморожених схем. diff --git a/i18n/uk/docusaurus-plugin-content-docs/current/polyglot/worker-compatibility-routing.md b/i18n/uk/docusaurus-plugin-content-docs/current/polyglot/worker-compatibility-routing.md index 1f964cd8fc7..a786da49ec2 100644 --- a/i18n/uk/docusaurus-plugin-content-docs/current/polyglot/worker-compatibility-routing.md +++ b/i18n/uk/docusaurus-plugin-content-docs/current/polyglot/worker-compatibility-routing.md @@ -73,8 +73,9 @@ DW_V2_SUPPORTED_COMPATIBILITIES=orders-2026-04-28,orders-2026-04-21 3. Зберігайте сумісну потужність для закріплених виконань, включно з пасивним очікуванням таймера, сигналу, активності чи дитини. 4. Дренуйте лише задля свідомої зупинки нових захоплень когорти. Якщо раннє дренування зупинило роботу, відновіть когорту та початкову сумісну збірку. 5. Для відкату нових запусків відновіть і просуньте відому справну когорту, потім відкотіть невдале розгортання. Наявні закріплення не змінюються. +6. Перевірте інвентар виведення старої збірки й виведіть її [захищеною дією retire](/docs/polyglot/worker-build-id-rollout#retire-a-build-or-queue), перш ніж зупиняти її воркери. -Нуль незавершених задач не доводить безпечного виведення збірки. Зберігайте артефакт і відновлення, поки закріплене виконання чи успадкований ланцюг можуть їх потребувати. [Server #519](https://github.com/durable-workflow/server/issues/519) відстежує окрему захищену функцію; цей список її не реалізує. +Нуль незавершених задач не доводить безпечного виведення збірки. Native Server 3.14.0 і новіші рахують закріплені виконання, відкладені повтори, таймери, активності, перевірки оновлень і розклади, що досі залежать від збірки чи черги, і відмовляють у виведенні з HTTP409, доки вони лишаються. ## Явний стан відсутнього воркера {#explicit-missing-worker-state} @@ -82,7 +83,7 @@ DW_V2_SUPPORTED_COMPATIBILITIES=orders-2026-04-28,orders-2026-04-21 ## Зв'язок із розгортанням збірок {#how-this-relates-to-build-id-rollouts} -Стан розгортання описує зареєстровану потужність і наміри нових запусків та життєвого циклу; сумісність визначає захоплення конкретної початкової задачі. Використовуйте обидва. Ні дренування, ні відкат не переписує надійну сумісність і не доводить можливості видалити збірку. +Стан розгортання описує зареєстровану потужність і наміри нових запусків та життєвого циклу; сумісність визначає захоплення конкретної початкової задачі. Використовуйте обидва. Ні дренування, ні відкат не переписує надійну сумісність і не доводить можливості видалити збірку; це вирішує інвентар захищеного виведення. ## Пов'язані матеріали {#related-references} diff --git a/i18n/uk/source-hashes.json b/i18n/uk/source-hashes.json index 9a91b96e8f1..235b9dcc593 100644 --- a/i18n/uk/source-hashes.json +++ b/i18n/uk/source-hashes.json @@ -98,8 +98,8 @@ "polyglot/task-matching-dispatch.md": "9c8ffbbee16b5da48e7882721d7ba8eac209a374a6ca766d93d2b17e825b203d", "polyglot/task-queue-admission.md": "efcf934876a27c153dd3ecd1a995e7c08b37452c79dfcbba1ae7fa0a8cbad327", "polyglot/visibility-query-language.md": "15790074c904c6cdbb1de8dfade95ea9ca6391f2f16412db517a2fb84ef08334", - "polyglot/worker-build-id-rollout.md": "da8d837abf5d3aea049b1cd9d2ec906afd0f5f32e7340f459f1aaf664c6c6b5a", - "polyglot/worker-compatibility-routing.md": "ef58f23c112f0e6b968927ba861177903adca21ed33b6b9371681e23a18b2994", + "polyglot/worker-build-id-rollout.md": "822de3400c55367511c69de02f540845a9569e7d8be63bcf062f938a9acfeb82", + "polyglot/worker-compatibility-routing.md": "b05150fe1e18ff6dcc6e8047bd445f5ef3522540f2102981d89c65e45770bb69", "polyglot/worker-protocol.md": "91b18b39d626c1288bfa3f6b8212fa8246aa14393cb489a39fe90379bc4cd4b2", "polyglot/workflow-signals.md": "cfef2937ff4052ebd00494cdec522ef9c830d58389dfd249342d667d5c583839", "polyglot/workflow-streams.md": "5675a8ea1b9d0b1f7223fecb90b3b048d3006670bf505950bc783709287a6432", diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/polyglot/worker-build-id-rollout.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/polyglot/worker-build-id-rollout.md index 9739b2dcef8..b441a55e347 100644 --- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/polyglot/worker-build-id-rollout.md +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/polyglot/worker-build-id-rollout.md @@ -12,7 +12,7 @@ keywords: [Worker 构建, 排空, 回滚, 金丝雀, 无版本 Worker] 晋升候选构建前,应使用其准确的应用代码重放具有代表性的运行中和最近关闭的历史。回滚前,应使用旧制品重放新构建写入的历史。请遵循[重放检查](../testing.md#replay-before-deployment);兼容的路由构建组或完整性检查通过,本身都不能证明重放兼容性。 -使用本指南检查 Worker 群组、选择新工作流使用的构建,并为已有运行保留兼容 Worker。提升构建会改变新启动的选择;排空会阻止该群组领取新任务。这些操作都不会迁移已有运行,也不能证明构建可以删除。 +使用本指南检查 Worker 群组、选择新工作流使用的构建,并为已有运行保留兼容 Worker。提升构建会改变新启动的选择;排空会阻止该群组领取新任务。这些操作都不会迁移已有运行,也不能证明构建可以删除;这一判断由[受保护的退役](#retire-a-build-or-queue)做出。 [Worker 兼容性与路由](/docs/polyglot/worker-compatibility-routing)介绍工作流任务、活动、重试、子工作流及 continue-as-new 保留的身份。群组范围是 `(namespace, task_queue, build_id)`。未提供 `build_id` 的注册属于无版本的 `null` 群组。 @@ -78,9 +78,9 @@ async with Client("https://durable-workflow.example", token=operator_token, 例如,旧构建可能有两个就绪任务和一个已租用任务,新构建却没有待处理任务。队列总数三不能说明哪组需要处理能力。如果旧构建没有活跃 Worker,应恢复旧构建的兼容容量,或在意外排空时显式恢复群组。增加新构建 Worker 无法处理固定到旧构建的任务。只有过期注册时,应先排查丢失的进程或心跳,再将其计为可用容量。 -缩减群组前,应谨慎检查它自身的任务数、新鲜 Worker、声明的工作流类型、可用槽位和排空意图。为租约及已有运行未来产生的工作保留容量。等待信号、定时器、活动或子工作流的运行,当前可能没有工作流任务,却仍会在未来需要旧构建。活动也可能使用其他已记录队列。此端点不能提供安全退役结论,也不授权将最后一个必要群组缩容至零。 +缩减群组前,应谨慎检查它自身的任务数、新鲜 Worker、声明的工作流类型、可用槽位和排空意图。为租约及已有运行未来产生的工作保留容量。等待信号、定时器、活动或子工作流的运行,当前可能没有工作流任务,却仍会在未来需要旧构建。活动也可能使用其他已记录队列。此端点不能提供安全退役结论,也不授权将最后一个必要群组缩容至零;请使用[受保护的退役](#retire-a-build-or-queue)。 -[Server #519](https://github.com/durable-workflow/server/issues/519)跟踪有保护的退役决策;[Server #534](https://github.com/durable-workflow/server/issues/534)跟踪独立的抓取指标与缩容至零能力。这份检查清单没有交付这些功能,也没有规定内置 KEDA/HPA 触发器。 +[Server #534](https://github.com/durable-workflow/server/issues/534)跟踪独立的抓取指标与缩容至零能力。此处没有规定内置 KEDA/HPA 触发器。 ## 首次从无版本切换到有版本 {#first-cutover-unversioned-to-versioned} @@ -93,7 +93,7 @@ async with Client("https://durable-workflow.example", token=operator_token, ``` 4. 保留兼容已有历史的 Worker。提升不会修改旧固定关系,排空也不是迁移。 -5. 只有在独立解决剩余依赖后才退役旧容量。任务计数为空或注册数为零都不足以证明安全。只要某个运行可能需要它,就保留构建产物及恢复途径。 +5. 旧构建的清单为空后,使用[受保护的退役](#retire-a-build-or-queue)将其退役。任务计数为空或注册数为零都不足以证明安全。只要某个运行可能需要它,就保留构建产物。 ## 对新构建进行金丝雀发布 {#canary-a-new-build} @@ -123,7 +123,53 @@ dw task-queue:drain orders-critical --namespace orders-prod --build-id orders-v1 dw task-queue:resume orders-critical --namespace orders-prod --build-id orders-v1 ``` -排空或停止全部 Worker 不能证明可以删除构建产物。此快照不提供有保护的退役决策。 +排空或停止全部 Worker 不能证明可以删除构建产物。排空仍是紧急停止手段:无论是否仍有工作固定在该构建上,它都会立即拒绝该构建的轮询。是否删除应由[受保护的退役](#retire-a-build-or-queue)决定。 + +## 退役构建或队列 {#retire-a-build-or-queue} + +Native Server 3.14.0 及更高版本会判断构建或队列能否安全移除,并在仍有任何活跃依赖时拒绝退役。要求 `GET /api/cluster/info` 中的 `capabilities.worker_build_retirement` 严格为 `true`;已发布的 PHP Server 不提供这些路由。与其他 build-id 路由一样,使用运维或管理员令牌以及命名空间。 + +| 目的 | HTTP 端点 | +| --- | --- | +| 检查单个构建 | `GET /api/deployments/{namespace}/{taskQueue}@{buildId}/retirement` (无版本群组使用 `@unversioned`) | +| 退役单个构建 | `POST /api/deployments/{namespace}/{taskQueue}@{buildId}/retire` | +| 检查队列上的所有群组 | `GET /api/task-queues/{taskQueue}/retirement` | +| 退役队列 | `POST /api/task-queues/{taskQueue}/retire` | + +1. 提升替代构建,并让旧构建的 Worker 继续运行。它们会完成仍固定在旧构建上的运行、延迟重试、定时器以及续接的链。 +2. 持续检查旧构建,直到 `retirable` 为 `true`: + + ```bash + dw task-queue:retirement orders-critical --namespace orders-prod --build-id orders-v1 --json + ``` + + 每个阻塞项都给出准确的 `count`、最多 20 个示例标识以及一个 `recovery` 操作:等待工作完成,或取消、终止你决定放弃的运行。 +3. 执行退役,可选择绑定到检查时得到的 `observation.inventory_revision`: + + ```bash + dw task-queue:retire orders-critical --namespace orders-prod --build-id orders-v1 \ + --expected-revision "$INVENTORY_REVISION" + ``` + +4. 只有在退役成功后,才停止旧构建的进程。 + +不带 `--build-id` 或 `--unversioned` 时,两个命令作用于队列上的所有群组。这些命令随 2.11.0 之后的第一个 CLI 版本发布;使用 CLI 2.11.0 或更早版本时,请直接调用 HTTP 路由。 + +清单统计固定在该构建上的未结束运行(包括等待中、已续接和子运行)、就绪、已租约和延迟的任务(尚未到期的活动重试和定时器)、未结束的活动、待处理的更新校验,以及(针对队列)在该队列上启动运行的计划。若存在未记录任务队列的未结束运行,清单为 `incomplete`,无法退役。 + +检查只是预览。退役操作会在启动、重试和任务创建所使用的同一个串行化转换中重新计数,并且只在没有剩余依赖时写入。被拒绝的退役返回 HTTP409,不做任何更改;请按照 `expected_resolution` 处理后重新检查。 + +| `reason` | 含义 | +| --- | --- | +| `unknown_deployment`, `unknown_task_queue` | 目标既没有已注册的 Worker,也没有已记录的发布。 | +| `selected_for_new_starts` | 队列上的新启动仍会选择此构建。请先提升替代构建。 | +| `inventory_incomplete` | 存在无法归属的未结束运行。清单缺失绝不等于允许退役。 | +| `live_dependencies` | 至少有一个阻塞项计数不为零。 | +| `inventory_changed` | `expected_inventory_revision` 已不再匹配。 | + +退役成功时返回 HTTP200,以及 `outcome: "retired"`、`retired_at` 和 `retired_by`。该构建的发布意图变为终止状态 `drained`:它不会再被选为新启动目标,无法通过部署生命周期提升或恢复,其 Worker 保持排空。当队列上的所有群组都已退役且没有活跃 Worker 时,该队列上的新启动会以 `task_queue_draining` 和 `routing_status: "retired"` 被拒绝,直到有新的活跃群组注册。运行固定关系、活动队列、历史和截止时间都不会改变。 + +如需恢复,`dw task-queue:resume`(`POST /api/task-queues/{taskQueue}/build-ids/resume`)会把已退役的构建重新设为 `active`;退役时已保证它当时没有任何工作。 ## 回滚有问题的构建 {#roll-back-a-bad-build} @@ -139,8 +185,10 @@ dw task-queue:resume orders-critical --namespace orders-prod --build-id orders-v | 为新启动提升构建 | `POST /api/task-queues/{taskQueue}/build-ids/promote` | `dw task-queue:promote` | `Client.promote_task_queue_build_id` | | 排空 | `POST /api/task-queues/{taskQueue}/build-ids/drain` | `dw task-queue:drain` | `Client.drain_task_queue_build_id` | | 恢复 | `POST /api/task-queues/{taskQueue}/build-ids/resume` | `dw task-queue:resume` | `Client.resume_task_queue_build_id` | +| 检查退役条件 | `GET /api/task-queues/{taskQueue}/retirement`, `GET /api/deployments/{name}/retirement` | `dw task-queue:retirement` | — | +| 退役 | `POST /api/task-queues/{taskQueue}/retire`, `POST /api/deployments/{name}/retire` | `dw task-queue:retire` | — | -这些变更接口接受 `{"build_id":"orders-v2"}`,无版本群组则使用 `{"build_id":null}`。CLI 只能选择 `--build-id` 或 `--unversioned` 之一。 +提升、排空和恢复路由接受 `{"build_id":"orders-v2"}`,无版本群组则使用 `{"build_id":null}`。退役路由接受可选的 `{"expected_inventory_revision":"..."}` 请求体。CLI 只能选择 `--build-id` 或 `--unversioned` 之一。 完整生命周期使用 `GET /api/deployments` 及 `POST /api/deployments/{name}/{promote,drain,resume,rollback}`。使用返回的名称,如 `orders-prod/orders-critical@orders-v2`,以及原命名空间。在已发布的 Apache 路径上,应保留名称中的斜杠分隔符:对整个复合名称编码可能在到达 API 前触发 Apache HTML404。被拒绝的操作返回 HTTP409,以及有类型的 `reason` 和 `blockages` 数组。检查 `expected_resolution`;拒绝不等于提升成功。独立的[Server #521](https://github.com/durable-workflow/server/issues/521)跟踪当前不完整的 OpenAPI 镜像,不代表新的运行时实现或冻结模式变更。 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/polyglot/worker-compatibility-routing.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/polyglot/worker-compatibility-routing.md index f9fa00896b1..e04ccc4c32c 100644 --- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/polyglot/worker-compatibility-routing.md +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/polyglot/worker-compatibility-routing.md @@ -73,8 +73,9 @@ DW_V2_SUPPORTED_COMPATIBILITIES=orders-2026-04-28,orders-2026-04-21 3. 为已有固定运行保留兼容容量,包括等待定时器、信号、活动或子工作流的被动运行。 4. 只有在确实要停止该群组领取新任务时才排空。若过早排空导致工作停滞,恢复群组及原始兼容构建。 5. 回滚新启动时,恢复已知正常群组并提升它,然后回滚问题部署。已有固定关系保持不变。 +6. 在停止旧构建的 Worker 之前,检查其退役清单,并通过[受保护的退役操作](/docs/polyglot/worker-build-id-rollout#retire-a-build-or-queue)将其退役。 -待处理工作流任务为零并不能证明安全退役。只要固定运行或继承链可能需要,就保留构建产物和恢复途径。[Server #519](https://github.com/durable-workflow/server/issues/519)跟踪独立的保护式退役能力,本清单并未交付该能力。 +待处理工作流任务为零并不能证明安全退役。Native Server 3.14.0 及更高版本会统计仍依赖某个构建或队列的固定运行、延迟重试、定时器、活动、更新校验和计划,只要仍有剩余,就以 HTTP409 拒绝退役。 ## 兼容 Worker 缺失的明确状态 {#explicit-missing-worker-state} @@ -82,7 +83,7 @@ DW_V2_SUPPORTED_COMPATIBILITIES=orders-2026-04-28,orders-2026-04-21 ## 与构建 ID 发布的关系 {#how-this-relates-to-build-id-rollouts} -发布状态描述已注册容量及新启动/生命周期意图;兼容性决定具体原始任务能否被领取。两者应结合使用。排空和回滚都不会改写持久兼容性,也不能证明构建可以删除。 +发布状态描述已注册容量及新启动/生命周期意图;兼容性决定具体原始任务能否被领取。两者应结合使用。排空和回滚都不会改写持久兼容性,也不能证明构建可以删除;这由受保护退役的清单决定。 ## 相关参考 {#related-references} diff --git a/i18n/zh-Hans/source-hashes.json b/i18n/zh-Hans/source-hashes.json index 9a91b96e8f1..235b9dcc593 100644 --- a/i18n/zh-Hans/source-hashes.json +++ b/i18n/zh-Hans/source-hashes.json @@ -98,8 +98,8 @@ "polyglot/task-matching-dispatch.md": "9c8ffbbee16b5da48e7882721d7ba8eac209a374a6ca766d93d2b17e825b203d", "polyglot/task-queue-admission.md": "efcf934876a27c153dd3ecd1a995e7c08b37452c79dfcbba1ae7fa0a8cbad327", "polyglot/visibility-query-language.md": "15790074c904c6cdbb1de8dfade95ea9ca6391f2f16412db517a2fb84ef08334", - "polyglot/worker-build-id-rollout.md": "da8d837abf5d3aea049b1cd9d2ec906afd0f5f32e7340f459f1aaf664c6c6b5a", - "polyglot/worker-compatibility-routing.md": "ef58f23c112f0e6b968927ba861177903adca21ed33b6b9371681e23a18b2994", + "polyglot/worker-build-id-rollout.md": "822de3400c55367511c69de02f540845a9569e7d8be63bcf062f938a9acfeb82", + "polyglot/worker-compatibility-routing.md": "b05150fe1e18ff6dcc6e8047bd445f5ef3522540f2102981d89c65e45770bb69", "polyglot/worker-protocol.md": "91b18b39d626c1288bfa3f6b8212fa8246aa14393cb489a39fe90379bc4cd4b2", "polyglot/workflow-signals.md": "cfef2937ff4052ebd00494cdec522ef9c830d58389dfd249342d667d5c583839", "polyglot/workflow-streams.md": "5675a8ea1b9d0b1f7223fecb90b3b048d3006670bf505950bc783709287a6432",