Skip to content

Commit

Permalink
[SPARK-42344][K8S] Change the default size of the CONFIG_MAP_MAXSIZE
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
nineinfra authored and dongjoon-hyun committed Feb 5, 2023
1 parent 2d539c5 commit cdb494b
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ private[spark] object Config extends Logging {
" https://etcd.io/docs/v3.4.0/dev-guide/limit/ on k8s server end.")
.version("3.1.0")
.longConf
.createWithDefault(1572864) // 1.5 MiB
.checkValue(_ <= 1048576, "Must have at most 1048576 bytes")
.createWithDefault(1048576) // 1.0 MiB

val EXECUTOR_ROLL_INTERVAL =
ConfigBuilder("spark.kubernetes.executor.rollInterval")
Expand Down

0 comments on commit cdb494b

Please sign in to comment.