nsivabalan commented on code in PR #7544:
URL: https://github.com/apache/hudi/pull/7544#discussion_r1056676874
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadataWriter.java:
##########
@@ -1019,21 +1021,27 @@ protected void compactIfNecessary(BaseHoodieWriteClient
writeClient, String inst
// finish off any pending compactions if any from previous attempt.
writeClient.runAnyPendingCompactions();
- String latestDeltaCommitTime =
metadataMetaClient.reloadActiveTimeline().getDeltaCommitTimeline().filterCompletedInstants().lastInstant()
- .get().getTimestamp();
- List<HoodieInstant> pendingInstants =
dataMetaClient.reloadActiveTimeline().filterInflightsAndRequested()
- .findInstantsBefore(instantTime).getInstants();
+ String latestDeltaCommitTimeInMetadataTable =
metadataMetaClient.reloadActiveTimeline()
+ .getDeltaCommitTimeline()
+ .filterCompletedInstants()
+ .lastInstant().orElseThrow(() -> new HoodieMetadataException("No
completed deltacommit in metadata table"))
+ .getTimestamp();
+ List<HoodieInstant> pendingInstantsInDataTable =
dataMetaClient.reloadActiveTimeline()
+ .filterInflightsAndRequested()
+ .getInstantsAsStream()
+ .filter(instant -> !instant.getTimestamp().equals(instantTime))
+ .collect(Collectors.toList());
- if (!pendingInstants.isEmpty()) {
+ if (!pendingInstantsInDataTable.isEmpty()) {
LOG.info(String.format("Cannot compact metadata table as there are %d
inflight instants before latest deltacommit %s: %s",
- pendingInstants.size(), latestDeltaCommitTime,
Arrays.toString(pendingInstants.toArray())));
+ pendingInstantsInDataTable.size(),
latestDeltaCommitTimeInMetadataTable,
Arrays.toString(pendingInstantsInDataTable.toArray())));
Review Comment:
can we fix the logging statement. it says "before".
--
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]