Skip to content

[SPARK-55603][K8S] Improve removeExecutorFromK8s to use patch instead of edit API#54376

Closed
dongjoon-hyun wants to merge 1 commit intoapache:masterfrom
dongjoon-hyun:SPARK-55603
Closed

[SPARK-55603][K8S] Improve removeExecutorFromK8s to use patch instead of edit API#54376
dongjoon-hyun wants to merge 1 commit intoapache:masterfrom
dongjoon-hyun:SPARK-55603

Conversation

@dongjoon-hyun
Copy link
Copy Markdown
Member

What changes were proposed in this pull request?

This PR aims to improve removeExecutorFromK8s to use patch instead of edit API.

Why are the changes needed?

Network Efficiency

  • edit requires fetching the entire resource and sending the full updated resource back.
  • patch only transmits the specific changes, making it much more network-efficient.

Concurrency & Conflict Resolution

  • edit typically follows a Get -> Modify -> Update (PUT) pattern. Using this pattern creates a race condition where, if another client modifies the resource in between, a 409 Conflict error occurs due to a mismatched resourceVersion.
  • patch sends only the changes (delta) to the server, where the merge is handled server-side. This significantly reduces the risk of conflicts, especially for simple operations like adding an annotation.

Does this PR introduce any user-facing change?

This will reduce the overhead of K8s control plane and the chance of 409 error.

How was this patch tested?

Pass the CIs with newly updated test case.

Was this patch authored or co-authored using generative AI tooling?

Generated-by: Gemini 3 Pro (High) on Antigravity

@dongjoon-hyun
Copy link
Copy Markdown
Member Author

Thank you, @HyukjinKwon . Merged to master for Apache Spark 4.2.0.

@dongjoon-hyun dongjoon-hyun deleted the SPARK-55603 branch February 19, 2026 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants