yyanyy commented on a change in pull request #2402:
URL: https://github.com/apache/iceberg/pull/2402#discussion_r605851603
##########
File path:
aws/src/main/java/org/apache/iceberg/aws/glue/GlueTableOperations.java
##########
@@ -103,14 +105,30 @@ protected void doRefresh() {
@Override
protected void doCommit(TableMetadata base, TableMetadata metadata) {
String newMetadataLocation = writeNewMetadata(metadata, currentVersion() +
1);
- boolean exceptionThrown = true;
+ CommitStatus commitStatus = CommitStatus.FAILURE;
+
try {
lock(newMetadataLocation);
Table glueTable = getGlueTable();
checkMetadataLocation(glueTable, base);
Map<String, String> properties = prepareProperties(glueTable,
newMetadataLocation);
- persistGlueTable(glueTable, properties);
- exceptionThrown = false;
+
+ try {
+ persistGlueTable(glueTable, properties);
+ commitStatus = CommitStatus.SUCCESS;
+ } catch (Throwable persistFailure) {
Review comment:
Thanks for the feedback!
For 1, I'm not confident if any type of network issue would end up as
`SdkException`, so I'd prefer to maintain a list of exceptions that won't go
through `checkCommitStatus` than a list that we will just to be on the safe
side.
For 2, sounds good, I'll move the catch logic to L137 but I'll convert it to
a `Throwable` to handle 1. This essentially means to not check commit status
for `ConcurrentModificationException` and `AlreadyExistsException` which I
think should be minimum risk.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]