ChristinaTech commented on code in PR #7198:
URL: https://github.com/apache/iceberg/pull/7198#discussion_r1157372844
##########
aws/src/main/java/org/apache/iceberg/aws/dynamodb/DynamoDbTableOperations.java:
##########
@@ -116,20 +118,30 @@ protected void doCommit(TableMetadata base, TableMetadata
metadata) {
.build());
checkMetadataLocation(table, base);
Map<String, String> properties = prepareProperties(table,
newMetadataLocation);
- persistTable(tableKey, table, properties);
+ persistTable(tableKey, table, properties, retryDetector);
commitStatus = CommitStatus.SUCCESS;
- } catch (ConditionalCheckFailedException e) {
- throw new CommitFailedException(
- e, "Cannot commit %s: concurrent update detected", tableName());
} catch (CommitFailedException e) {
// any explicit commit failures are passed up and out to the retry
handler
throw e;
} catch (RuntimeException persistFailure) {
- LOG.error(
- "Confirming if commit to {} indeed failed to persist, attempting to
reconnect and check.",
- fullTableName,
- persistFailure);
- commitStatus = checkCommitStatus(newMetadataLocation, metadata);
+ boolean conditionCheckFailed = persistFailure instanceof
ConditionalCheckFailedException;
+
+ // If we got an exception we weren't expecting, or we got a
ConditionalCheckFailedException
+ // but retries were performed, attempt to reconcile the actual commit
status.
+ if (!conditionCheckFailed || retryDetector.retried()) {
+ LOG.error(
+ "Confirming if commit to {} indeed failed to persist, attempting
to reconnect and check.",
+ fullTableName,
+ persistFailure);
Review Comment:
This message predates this PR, and I generally try to avoid making changes
beyond the scope of what I am trying to fix. That said, I don't actually take
issue with the change in log level or error message save one thing. I am going
to modify your new message slightly so it still reports the table name like the
current message does.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]