[SPARK-55330][K8S] Make spark.kubernetes.legacy.useReadWriteOnceAccessMode a public config#54963
Open
nitrajen wants to merge 2 commits intoapache:masterfrom
Open
[SPARK-55330][K8S] Make spark.kubernetes.legacy.useReadWriteOnceAccessMode a public config#54963nitrajen wants to merge 2 commits intoapache:masterfrom
nitrajen wants to merge 2 commits intoapache:masterfrom
Conversation
…sMode a public config
0f02261 to
4733a29
Compare
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?
spark.kubernetes.legacy.useReadWriteOnceAccessModewas introduced in SPARK-46945 as an.internal()config. This PR removes the.internal()marker and improves the doc string so the config appears in the public documentation and can be used by operators.Why are the changes needed?
SPARK-46786 (Spark 4.0) changed the default PVC access mode from
ReadWriteOncetoReadWriteOncePod. The Kubernetes documentation states that whetherfsGroupis applied to a mounted volume depends on the CSI driver'sfsGroupPolicysetting, and certain policies do not applyfsGroupforReadWriteOncePodvolumes. This can cause non-root executor processes to fail at job startup when trying to create theblockmgr-xxxdirectory under a PVC-backed local dir:The escape hatch config (
spark.kubernetes.legacy.useReadWriteOnceAccessMode=true) already exists in the codebase to restoreReadWriteOncebehavior, but because it is marked internal it does not appear in the docs and users cannot find it.Does this PR introduce any user-facing change?
Yes.
spark.kubernetes.legacy.useReadWriteOnceAccessModebecomes a public, documented configuration option (versioned as 4.2.0). Previously it was internal and invisible to users.How was this patch tested?
Added two unit tests to
MountVolumesFeatureStepSuite:SPARK-55330: OnDemand PVC uses ReadWriteOncePod access mode by default— verifies the default PVC access mode isReadWriteOncePodSPARK-55330: OnDemand PVC uses ReadWriteOnce when legacy access mode is enabled— verifies that settingspark.kubernetes.legacy.useReadWriteOnceAccessMode=trueresults in PVCs being created withReadWriteOnceBoth tests use
getAdditionalKubernetesResources()onMountVolumesFeatureStepand assert theaccessModesfield on the returnedPersistentVolumeClaim.Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Sonnet 4.6