flyrain commented on a change in pull request #2552:
URL: https://github.com/apache/iceberg/pull/2552#discussion_r628646974
##########
File path: core/src/main/java/org/apache/iceberg/MergingSnapshotProducer.java
##########
@@ -390,7 +394,16 @@ protected void validateDataFilesExist(TableMetadata base,
Long startingSnapshotI
@Override
public Object updateEvent() {
long snapshotId = snapshotId();
- long sequenceNumber = ops.refresh().snapshot(snapshotId).sequenceNumber();
+ Snapshot justSaved = ops.refresh().snapshot(snapshotId);
+ long sequenceNumber = TableMetadata.INVALID_SEQUENCE_NUMBER;
+ if (justSaved == null) {
+ // The snapshot just saved may not be present if the latest metadata
couldn't be loaded due to eventual
+ // consistency problems in refresh.
+ LOG.warn("Failed to load committed snapshot, leave its sequence number
to an invalid number(-1)");
Review comment:
There is a retry in the main part of method `commit()`, not for clean-up
and `notifyListeners`. I'm not sure if it's a good idea to introduce retry to
them. I didn't see much downside, at most delay the commit, but feel like it is
a bit over engineering. It is going to be the next PR anyway.
--
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]