You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/04/06 03:14:46 UTC
[GitHub] [iceberg] southernriver opened a new pull request, #4507: Skipping manifest clean-up for all Error or Exception.
southernriver opened a new pull request, #4507:
URL: https://github.com/apache/iceberg/pull/4507
In our production environment, we found operation committed success but some data files were deleted, we could not read current-snapshot due to FileNotFoundException.
The manifest clean-up may throw Exception or Error, and we should also catch RuntimeError like `OutOfMemoryError`, otherwise, it would lead to abort and delete datafile.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] kbendick commented on a diff in pull request #4507: Core: Skipping manifest clean-up for all Error or Exception.
Posted by GitBox <gi...@apache.org>.
kbendick commented on code in PR #4507:
URL: https://github.com/apache/iceberg/pull/4507#discussion_r844131066
##########
core/src/main/java/org/apache/iceberg/SnapshotProducer.java:
##########
@@ -343,8 +343,8 @@ public void commit() {
LOG.warn("Failed to load committed snapshot, skipping manifest clean-up");
}
- } catch (RuntimeException e) {
- LOG.warn("Failed to load committed table metadata, skipping manifest clean-up", e);
+ } catch (Throwable t) {
Review Comment:
My understanding has always been that we should only catch non-fatal exceptions.
Is there anyway we can slim down the scope / amount of code that this larger `try-catch` block covers?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Core: Skipping manifest clean-up for all Error or Exception. [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #4507: Core: Skipping manifest clean-up for all Error or Exception.
URL: https://github.com/apache/iceberg/pull/4507
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Core: Skipping manifest clean-up for all Error or Exception. [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #4507:
URL: https://github.com/apache/iceberg/pull/4507#issuecomment-2290114387
This pull request has been closed due to lack of activity. This is not a judgement on the merit of the PR in any way. It is just a way of keeping the PR queue manageable. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] southernriver commented on pull request #4507: Core: Skipping manifest clean-up for all Error or Exception.
Posted by GitBox <gi...@apache.org>.
southernriver commented on PR #4507:
URL: https://github.com/apache/iceberg/pull/4507#issuecomment-1094464138
> I'm not sure how the changes in this PR would help, since it just makes a warning more broad. The catch clauses that are updated here don't actually change what happens other than to log a warning in unrelated cases.
>
> I'm also skeptical that this is the right thing to do. The chance of an OOM causing a commit to appear like it did not succeed when it actually did is incredibly small... and besides, cleanup is run when a `RuntimeException` is caught. That means that an Error wouldn't actually cause the commit path to remove live data files.
>
> @southernriver, It sounds like the problem that you actually hit was with Spark's error handling and cleanup instead? Maybe we should change the Spark writer instead to avoid triggering its abort path in certain cases. That's a very different change.
@rdblue Thanks for your comment. Iceberg itself implements the SparkWrite#abort method and could delete datafile with uncatched `java.lang.Error` or `java.lang.Exception`. ` RuntimeException` can not cover`OutOfMemoryError` , so I did catch all `java.lang.Throwable` to avoid clean-up live data files.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] southernriver commented on pull request #4507: Skipping manifest clean-up for all Error or Exception.
Posted by GitBox <gi...@apache.org>.
southernriver commented on PR #4507:
URL: https://github.com/apache/iceberg/pull/4507#issuecomment-1089734326
@rdblue @openinx Could you please have a look at this, it's a serious bug.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] kbendick commented on a diff in pull request #4507: Core: Skipping manifest clean-up for all Error or Exception.
Posted by GitBox <gi...@apache.org>.
kbendick commented on code in PR #4507:
URL: https://github.com/apache/iceberg/pull/4507#discussion_r844131066
##########
core/src/main/java/org/apache/iceberg/SnapshotProducer.java:
##########
@@ -343,8 +343,8 @@ public void commit() {
LOG.warn("Failed to load committed snapshot, skipping manifest clean-up");
}
- } catch (RuntimeException e) {
- LOG.warn("Failed to load committed table metadata, skipping manifest clean-up", e);
+ } catch (Throwable t) {
Review Comment:
My understanding has always been that we should only catch non-fatal exceptions.
Is there anyway we can slim down the scope / amount of code that this larger `try-catch` block covers? Any large `try-catch` makes me nervous, but particularly when we make the catch statement more broad.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Core: Skipping manifest clean-up for all Error or Exception. [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #4507:
URL: https://github.com/apache/iceberg/pull/4507#issuecomment-2274584120
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] southernriver commented on pull request #4507: Core: Skipping manifest clean-up for all Error or Exception.
Posted by GitBox <gi...@apache.org>.
southernriver commented on PR #4507:
URL: https://github.com/apache/iceberg/pull/4507#issuecomment-1090998127
@kbendick Thank you. Manifest clean-up operation could throw `OutOfMemoryError` , For Spark-Side, Job callback to SparkWrite.abort:
```
private void abort(WriterCommitMessage[] messages) {
Map<String, String> props = table.properties();
Tasks.foreach(files(messages))
.retry(PropertyUtil.propertyAsInt(props, COMMIT_NUM_RETRIES, COMMIT_NUM_RETRIES_DEFAULT))
.exponentialBackoff(
PropertyUtil.propertyAsInt(props, COMMIT_MIN_RETRY_WAIT_MS, COMMIT_MIN_RETRY_WAIT_MS_DEFAULT),
PropertyUtil.propertyAsInt(props, COMMIT_MAX_RETRY_WAIT_MS, COMMIT_MAX_RETRY_WAIT_MS_DEFAULT),
PropertyUtil.propertyAsInt(props, COMMIT_TOTAL_RETRY_TIME_MS, COMMIT_TOTAL_RETRY_TIME_MS_DEFAULT),
2.0 /* exponential */)
.throwFailureWhenFinished()
.run(file -> {
table.io().deleteFile(file.path().toString());
});
}
```
It would delete datafile. And then if we read from current snapshot, `java.io.FileNotFoundException` would be thrown:
<img width="1554" alt="image" src="https://user-images.githubusercontent.com/20614350/162104740-fb1339db-2f74-4394-802d-dbc443447a4d.png">
it's easy to reproduce this problem, you can just throw `OutOfMemoryError` in try block.
` throw new OutOfMemoryError("oom");
`
BTW, I think clean-up is not necessary after committed success, and we can catch all exception or error.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] rdblue commented on pull request #4507: Core: Skipping manifest clean-up for all Error or Exception.
Posted by GitBox <gi...@apache.org>.
rdblue commented on PR #4507:
URL: https://github.com/apache/iceberg/pull/4507#issuecomment-1094376204
I'm not sure how the changes in this PR would help, since it just makes a warning more broad. The catch clauses that are updated here don't actually change what happens other than to log a warning in unrelated cases.
I'm also skeptical that this is the right thing to do. The chance of an OOM causing a commit to appear like it did not succeed when it actually did is incredibly small... and besides, cleanup is run when a `RuntimeException` is caught. That means that an Error wouldn't actually cause the commit path to remove live data files.
@southernriver, It sounds like the problem that you actually hit was with Spark's error handling and cleanup instead? Maybe we should change the Spark writer instead to avoid triggering its abort path in certain cases. That's a very different change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org