prashantwason commented on code in PR #18033:
URL: https://github.com/apache/hudi/pull/18033#discussion_r2756403071
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadataWriterTableVersionSix.java:
##########
@@ -87,15 +87,35 @@ List<MetadataPartitionType>
getEnabledPartitions(HoodieMetadataConfig metadataCo
@Override
boolean shouldInitializeFromFilesystem(Set<String> pendingDataInstants,
Option<String> inflightInstantTimestamp) {
- if (pendingDataInstants.stream()
- .anyMatch(i -> !inflightInstantTimestamp.isPresent() ||
!i.equals(inflightInstantTimestamp.get()))) {
- metrics.ifPresent(m ->
m.updateMetrics(HoodieMetadataMetrics.BOOTSTRAP_ERR_STR, 1));
- LOG.warn("Cannot initialize metadata table as operation(s) are in
progress on the dataset: {}",
- Arrays.toString(pendingDataInstants.toArray()));
- return false;
- } else {
- return true;
+ // Check if there are pending data instants that are not the current
inflight instant
Review Comment:
Added tests in `TestHoodieBackedTableMetadataWriterTableVersionSix.java`
covering the following scenarios:
- No pending data instants → allows initialization
- Only current inflight instant is pending → allows initialization
- Blocking instants with no rollbacks → blocks initialization
- All blocking instants have pending rollbacks → allows initialization
- Only some blocking instants have rollbacks → blocks initialization
- Mixed scenario with current inflight + rollbacks for others
- Completed rollbacks do not count as pending rollbacks
##########
hudi-common/src/main/java/org/apache/hudi/common/table/view/AbstractTableFileSystemView.java:
##########
@@ -422,11 +422,13 @@ private void ensurePartitionsLoadedCorrectly(List<String>
partitionList) {
LOG.debug("Time taken to list partitions {} ={}", partitionSet,
(endLsTs - beginLsTs));
pathInfoMap.forEach((partitionPair, statuses) -> {
String relativePartitionStr = partitionPair.getLeft();
- List<HoodieFileGroup> groups =
addFilesToView(relativePartitionStr, statuses);
+ // Filter out stray files that are not valid HUDI data or log files
+ List<StoragePathInfo> validDataFiles =
filterValidDataFiles(statuses);
Review Comment:
You're right, this was unrelated. I've removed it from this PR.
--
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]