[SPARK-55410][K8S] Improve SparkKubernetesDiagnosticsSetter to use patch instead of edit API#54194
Open
dongjoon-hyun wants to merge 1 commit intoapache:masterfrom
Open
[SPARK-55410][K8S] Improve SparkKubernetesDiagnosticsSetter to use patch instead of edit API#54194dongjoon-hyun wants to merge 1 commit intoapache:masterfrom
SparkKubernetesDiagnosticsSetter to use patch instead of edit API#54194dongjoon-hyun wants to merge 1 commit intoapache:masterfrom
Conversation
JIRA Issue Information=== Sub-task SPARK-55410 === This comment was automatically generated by GitHub Actions |
…`patch` instead of `edit` API
aa029c5 to
0eacf12
Compare
Member
Author
|
GitHub Action is running here. |
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?
This PR aims to improve
SparkKubernetesDiagnosticsSetterto usepatchinstead ofeditAPIWhy are the changes needed?
Network Efficiency
editrequires fetching the entire resource and sending the full updated resource back.patchonly transmits the specific changes, making it much more network-efficient.Concurrency & Conflict Resolution
edittypically 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.patchsends 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:
Opus 4.5onClaude Code