Skip to content

Commit cdb494b

Browse files
nineinfradongjoon-hyun
authored andcommitted
[SPARK-42344][K8S] Change the default size of the CONFIG_MAP_MAXSIZE
The default size of the CONFIG_MAP_MAXSIZE should not be greater than 1048576 ### What changes were proposed in this pull request? This PR changed the default size of the CONFIG_MAP_MAXSIZE from 1572864(1.5 MiB) to 1048576(1.0 MiB) ### Why are the changes needed? When a job is submitted by the spark to the K8S with a configmap , The Spark-Submit will call the K8S‘s POST API "api/v1/namespaces/default/configmaps". And the size of the configmaps will be validated by this K8S API,the max value shoud not be greater than 1048576. In the previous comment,the explain in https://etcd.io/docs/v3.4/dev-guide/limit/ is: "etcd is designed to handle small key value pairs typical for metadata. Larger requests will work, but may increase the latency of other requests. By default, the maximum size of any request is 1.5 MiB. This limit is configurable through --max-request-bytes flag for etcd server." This explanation is from the perspective of etcd ,not K8S. So I think the default value of the configmap in Spark should not be greate than 1048576. ### Does this PR introduce _any_ user-facing change? Yes. Generally, the size of the configmap will not exceed 1572864 or even 1048576. So the problem solved here may not be perceived by users. ### How was this patch tested? local test Closes #39884 from ninebigbig/master. Authored-by: Yan Wei <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]> (cherry picked from commit 9ac4640) Signed-off-by: Dongjoon Hyun <[email protected]> (cherry picked from commit d07a0e9) Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent 2d539c5 commit cdb494b

File tree

1 file changed

+2
-1
lines changed
  • resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s

1 file changed

+2
-1
lines changed

resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/Config.scala

+2-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ private[spark] object Config extends Logging {
136136
" https://etcd.io/docs/v3.4.0/dev-guide/limit/ on k8s server end.")
137137
.version("3.1.0")
138138
.longConf
139-
.createWithDefault(1572864) // 1.5 MiB
139+
.checkValue(_ <= 1048576, "Must have at most 1048576 bytes")
140+
.createWithDefault(1048576) // 1.0 MiB
140141

141142
val EXECUTOR_ROLL_INTERVAL =
142143
ConfigBuilder("spark.kubernetes.executor.rollInterval")

0 commit comments

Comments
 (0)