nsivabalan commented on code in PR #7638:
URL: https://github.com/apache/hudi/pull/7638#discussion_r1066160180
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadataWriter.java:
##########
@@ -1040,6 +1043,23 @@ protected void compactIfNecessary(BaseHoodieWriteClient
writeClient, String inst
}
}
+ /**
+ * If there is an instant that is stuck pending, compaction will never occur
and the log length will grow unbounded.
+ * Throw an exception if MAX_LOG_FILE_LIST_LENGTH is exceeded.
+ */
+ private void checkLogFileListLength() {
+ Option<HoodieInstant> lastCompaction =
metadataMetaClient.reloadActiveTimeline().getCommitTimeline().filterCompletedInstants().lastInstant();
+ int logSize;
+ if (lastCompaction.isPresent()) {
+ logSize =
metadataMetaClient.getActiveTimeline().getDeltaCommitTimeline().findInstantsAfter(lastCompaction.get().getTimestamp()).countInstants();
+ } else {
+ logSize =
metadataMetaClient.getActiveTimeline().getDeltaCommitTimeline().countInstants();
+ }
+ if (logSize > MAX_LOG_FILE_LIST_LENGTH) {
+ throw new HoodieException("List of log files has grown beyond " +
MAX_LOG_FILE_LIST_LENGTH + ".");
Review Comment:
lets fix the log msg.
"Looks like metadata table log files are growing unbounded due to a pending
instant in data table timeline. Please fix that and restart the pipeline".
--
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]