[CELEBORN-2375] Support DecommissionThenIdle and Recommission via wor…#3753
Open
gaoyajun02 wants to merge 1 commit into
Open
[CELEBORN-2375] Support DecommissionThenIdle and Recommission via wor…#3753gaoyajun02 wants to merge 1 commit into
gaoyajun02 wants to merge 1 commit into
Conversation
…ker-local HTTP API Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3753 +/- ##
============================================
+ Coverage 57.53% 57.68% +0.15%
Complexity 214 214
============================================
Files 396 397 +1
Lines 27857 27910 +53
Branches 2710 2713 +3
============================================
+ Hits 16025 16096 +71
+ Misses 10682 10663 -19
- Partials 1150 1151 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Comment on lines
+99
to
+102
| def workerEvent(request: WorkerEventRequest): HandleResponse = { | ||
| if (request.getEventType == null) { | ||
| return new HandleResponse().success(false).message("eventType is required") | ||
| } |
Comment on lines
+249
to
+254
| requestBody: | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: '#/components/schemas/WorkerEventRequest' | ||
| responses: |
Comment on lines
+784
to
+797
| WorkerEventRequest: | ||
| type: object | ||
| properties: | ||
| event_type: | ||
| type: string | ||
| description: | | ||
| The type of the worker event. | ||
| Legal types are 'DECOMMISSIONTHENIDLE' and 'RECOMMISSION'. | ||
| enum: | ||
| - DECOMMISSIONTHENIDLE | ||
| - RECOMMISSION | ||
| required: | ||
| - event_type | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Introduces a new
POST /api/v1/workers/eventsendpoint to the Worker HTTP API that allows operators to trigger worker state transitions directly on a specific worker node, without going through the Master:POST /api/v1/workers/events
{"eventType": "DECOMMISSIONTHENIDLE"} # drain traffic, stay alive
{"eventType": "RECOMMISSION"} # bring worker back to Normal
The endpoint is backed by:
WorkerEventRequest— a new request model exposing only the two state-transition event types (DECOMMISSIONTHENIDLE,RECOMMISSION), deliberately excluding exit-bound types (DECOMMISSION,GRACEFUL,IMMEDIATELY) which belong to the existing/exitendpoint.Worker#workerEvent()— routes the event toWorkerStatusManager#doTransition(), reusing the existing state-machine logic.WorkerApi#workerEvent()— corresponding method in the generated Java client.Why are the changes needed?
The existing
POST /api/v1/workers/exitendpoint conflates two semantically different operations — traffic draining and process termination — by acceptingDECOMMISSION,GRACEFUL, andIMMEDIATELYas exit types.DecommissionThenIdleis fundamentally different: it removes the worker from the serving path while keeping the process alive, making it unsuitable for/exitboth semantically and operationally.The Master already exposes
POST /api/v1/workers/eventsfor cluster-wide worker lifecycle management. However, that endpoint requires the caller to resolve the current Master leader and know the target worker's full identity before dispatching the request. In practice — especially in multi-cluster deployments where dozens of independent Celeborn clusters share the same operations platform — requiring maintenance scripts to first discover the active Master leader per cluster significantly increases operational complexity and the blast radius of mis-targeting. A worker-local endpoint removes this indirection entirely: the script targets the exact host being decommissioned, sends a single HTTP request, and the worker handles the rest. A subsequentRECOMMISSIONcall to the same host restores the worker to service without a restart, making the operation fully reversible.Does this PR resolve a correctness bug?
Does this PR introduce any user-facing change?
A new REST endpoint
POST /api/v1/workers/eventsis added to the Worker HTTP API, along with a correspondingworkerEvent()method in the generated Java client (WorkerApi). Operators can now triggerDECOMMISSIONTHENIDLEandRECOMMISSIONstate transitions directly on a worker node without routing through the Master.How was this patch tested?
UT