-
Notifications
You must be signed in to change notification settings - Fork 3k
Spark 3.5: Add max allowed failed commits to RewriteDataFiles when partial progress is enabled #9611
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 3.5: Add max allowed failed commits to RewriteDataFiles when partial progress is enabled #9611
Conversation
|
@amogh-jahagirdar This is based on our discussion in #9400, but I'd like to go one step further. Throwing exception and fail can work with alert system easier than logging an error. WDYT? |
core/src/main/java/org/apache/iceberg/actions/BaseCommitService.java
Outdated
Show resolved
Hide resolved
| } else if (failedCommits > maxFailedCommits) { | ||
| String errorMessage = | ||
| String.format( | ||
| "%s is true but %d rewrite commits failed. This is more than the maximum allowed failures of %d. " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should mention this message is generated by GitHub copilot.
4827464 to
8faaa67
Compare
8faaa67 to
cbd5198
Compare
cbd5198 to
0e09e09
Compare
|
Sorry for the delay. I didn't forget. |
...k/v3.5/spark/src/main/java/org/apache/iceberg/spark/actions/RewriteDataFilesSparkAction.java
Outdated
Show resolved
Hide resolved
spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/actions/TestRewriteDataFilesAction.java
Outdated
Show resolved
Hide resolved
aokolnychyi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me.
0e09e09 to
8069af1
Compare
| String.format( | ||
| "%s is true but %d rewrite commits failed. This is more than the maximum allowed failures of %d. " | ||
| + "Check the logs to determine why the individual commits failed. If this is persistent it may help to " | ||
| + "increase %s which will break the rewrite operation into smaller commits.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: instead of break maybe use split?
| table.refresh(); | ||
|
|
||
| List<Object[]> postRewriteData = currentData(); | ||
| assertEquals("We shouldn't have changed the data", originalData, postRewriteData); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| assertEquals("We shouldn't have changed the data", originalData, postRewriteData); | |
| assertThat(postRewriteData).isEqualTo(originalData); |
nastra
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with some nits that would be good to address
8069af1 to
d13f167
Compare
|
Looks like there are some related test failures: |
|
I think we should continue to use |
…rtial progress is enabled
d13f167 to
0c42809
Compare
|
Thanks, @manuzhang! Thanks for reviewing, @nastra @RussellSpitzer! |
…mits this backports apache#9449 and apache#9611 to Spark 3.4
…mits this backports apache#9449 and apache#9611 to Spark 3.4
…mits this backports apache#9449 and apache#9611 to Spark 3.4
When partial progress is enabled,
rewrite_data_filesSpark app can succeed without any "progress" (commits). This PR adds an optionpartial-progress.max-failed-commitsand a RuntimeException will be thrown if the number of failed commits exceed it. The default value ispartital-progress.max-commitsto be consistent with current behavior.