Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-49741][DOCS] Add spark.shuffle.accurateBlockSkewedFactor to config docs page #48189

Conversation

timlee0119
Copy link
Contributor

@timlee0119 timlee0119 commented Sep 20, 2024

What changes were proposed in this pull request?

spark.shuffle.accurateBlockSkewedFactor was added in Spark 3.3.0 in https://issues.apache.org/jira/browse/SPARK-36967 and is a useful shuffle configuration to prevent issues where HighlyCompressedMapStatus wrongly estimates the shuffle block sizes when the block size distribution is skewed, which can cause the shuffle reducer to fetch too much data and OOM. This PR adds this config to the Spark config docs page to make it discoverable.

Why are the changes needed?

To make this useful config discoverable by users and make them able to resolve shuffle fetch OOM issues themselves.

Does this PR introduce any user-facing change?

Yes, this is a documentation fix. Before this PR there's no spark.sql.adaptive.skewJoin.skewedPartitionFactor in the Shuffle Behavior section on the Configurations page and now there is.

How was this patch tested?

On the IDE:
image
Updated:
image

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

No

@github-actions github-actions bot added the DOCS label Sep 20, 2024
Copy link
Contributor

@JoshRosen JoshRosen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 on documenting this, as this is a useful configuration. Looks like the docs generally match

private[spark] val SHUFFLE_ACCURATE_BLOCK_SKEWED_FACTOR =
ConfigBuilder("spark.shuffle.accurateBlockSkewedFactor")
.internal()
.doc("A shuffle block is considered as skewed and will be accurately recorded in " +
"HighlyCompressedMapStatus if its size is larger than this factor multiplying " +
"the median shuffle block size or SHUFFLE_ACCURATE_BLOCK_THRESHOLD. It is " +
"recommended to set this parameter to be the same as SKEW_JOIN_SKEWED_PARTITION_FACTOR." +
"Set to -1.0 to disable this feature by default.")
.version("3.3.0")
.doubleConf
.createWithDefault(-1.0)
so looks good overall to me, just left one suggestion about moving this down a few rows so it's next to a related configuration in the table.

@@ -1010,6 +1010,19 @@ Apart from these, the following properties are also available, and may be useful
</td>
<td>2.2.1</td>
</tr>
<tr>
<td><code>spark.shuffle.accurateBlockSkewedFactor</code></td>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that the spark.shuffle.accurateBlockThreshold configuration is already documented in this table. It looks like we're preexistingly inconsistent about alphabetizing this list.

What do you think about either moving this new configuration a bit further down so it's next to spark.shuffle.accurateBlockThreshold?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, also updated the test section
image

@dongjoon-hyun dongjoon-hyun changed the title [SPARK-49741][Docs] Add spark.sql.adaptive.skewJoin.skewedPartitionFactor to config docs page [SPARK-49741][Docs] Add spark.sql.adaptive.skewJoin.skewedPartitionFactor to config docs page Sep 21, 2024
@@ -1222,6 +1222,19 @@ Apart from these, the following properties are also available, and may be useful
</td>
<td>2.2.1</td>
</tr>
<tr>
<td><code>spark.shuffle.accurateBlockSkewedFactor</code></td>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To @timlee0119 and @JoshRosen , shall we remove .internal() from the configuration definition together?

private[spark] val SHUFFLE_ACCURATE_BLOCK_SKEWED_FACTOR =
ConfigBuilder("spark.shuffle.accurateBlockSkewedFactor")
.internal()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition, the PR title looks wrong to me because we are touching spark.shuffle.accurateBlockSkewedFactor instead of spark.sql.adaptive.....

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I would match the description

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the typo, I've fixed the PR title and removed internal()

@timlee0119 timlee0119 changed the title [SPARK-49741][Docs] Add spark.sql.adaptive.skewJoin.skewedPartitionFactor to config docs page [SPARK-49741][Docs] Add spark.shuffle.accurateBlockSkewedFactor to config docs page Sep 21, 2024
@github-actions github-actions bot added the CORE label Sep 21, 2024
@dongjoon-hyun dongjoon-hyun changed the title [SPARK-49741][Docs] Add spark.shuffle.accurateBlockSkewedFactor to config docs page [SPARK-49741][Docs] Add spark.shuffle.accurateBlockSkewedFactor to config docs page Sep 22, 2024
Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, LGTM. Thank you.

@HyukjinKwon HyukjinKwon changed the title [SPARK-49741][Docs] Add spark.shuffle.accurateBlockSkewedFactor to config docs page [SPARK-49741][DOCS] Add spark.shuffle.accurateBlockSkewedFactor to config docs page Sep 22, 2024
@HyukjinKwon
Copy link
Member

Merged to master.

attilapiros pushed a commit to attilapiros/spark that referenced this pull request Oct 4, 2024
…config docs page

### What changes were proposed in this pull request?

`spark.shuffle.accurateBlockSkewedFactor` was added in Spark 3.3.0 in https://issues.apache.org/jira/browse/SPARK-36967 and is a useful shuffle configuration to prevent issues where `HighlyCompressedMapStatus` wrongly estimates the shuffle block sizes when the block size distribution is skewed, which can cause the shuffle reducer to fetch too much data and OOM. This PR adds this config to the Spark config docs page to make it discoverable.

### Why are the changes needed?

To make this useful config discoverable by users and make them able to resolve shuffle fetch OOM issues themselves.

### Does this PR introduce _any_ user-facing change?

Yes, this is a documentation fix. Before this PR there's no `spark.sql.adaptive.skewJoin.skewedPartitionFactor` in the `Shuffle Behavior` section on [the Configurations page](https://spark.apache.org/docs/latest/configuration.html) and now there is.

### How was this patch tested?

On the IDE:
<img width="1633" alt="image" src="https://github.com/user-attachments/assets/616a94b9-2408-491c-a17b-c6dbdff14465">
Updated:
<img width="1274" alt="image" src="https://github.com/user-attachments/assets/ba170e9a-eba2-4fdf-85eb-a3aebefc055e">

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

No

Closes apache#48189 from timlee0119/add-accurate-block-skewed-factor-to-doc.

Authored-by: Tim Lee <[email protected]>
Signed-off-by: Hyukjin Kwon <[email protected]>
himadripal pushed a commit to himadripal/spark that referenced this pull request Oct 19, 2024
…config docs page

### What changes were proposed in this pull request?

`spark.shuffle.accurateBlockSkewedFactor` was added in Spark 3.3.0 in https://issues.apache.org/jira/browse/SPARK-36967 and is a useful shuffle configuration to prevent issues where `HighlyCompressedMapStatus` wrongly estimates the shuffle block sizes when the block size distribution is skewed, which can cause the shuffle reducer to fetch too much data and OOM. This PR adds this config to the Spark config docs page to make it discoverable.

### Why are the changes needed?

To make this useful config discoverable by users and make them able to resolve shuffle fetch OOM issues themselves.

### Does this PR introduce _any_ user-facing change?

Yes, this is a documentation fix. Before this PR there's no `spark.sql.adaptive.skewJoin.skewedPartitionFactor` in the `Shuffle Behavior` section on [the Configurations page](https://spark.apache.org/docs/latest/configuration.html) and now there is.

### How was this patch tested?

On the IDE:
<img width="1633" alt="image" src="https://github.com/user-attachments/assets/616a94b9-2408-491c-a17b-c6dbdff14465">
Updated:
<img width="1274" alt="image" src="https://github.com/user-attachments/assets/ba170e9a-eba2-4fdf-85eb-a3aebefc055e">

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

No

Closes apache#48189 from timlee0119/add-accurate-block-skewed-factor-to-doc.

Authored-by: Tim Lee <[email protected]>
Signed-off-by: Hyukjin Kwon <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants