danny0405 opened a new pull request, #19786: URL: https://github.com/apache/hudi/pull/19786
### Describe the issue this Pull Request addresses With MOR tables using the bucket index and non-blocking concurrency control, a failed first write can leave an uncommitted log file as the earliest physical file in a file group. The file group is then anchored at that uncommitted instant, causing the committed slice APIs to discard the entire slice, including later committed logs. Closes #19774 ### Summary and Changelog This change constructs log-only file groups around the earliest completed log so that a failed leading log cannot hide later committed data. - Add log files to `HoodieFileGroup` as a batch sorted by delta-commit time. - When a file group has no existing base or compaction slice, establish the earliest completed log instant as the initial slice base. - Route earlier pending logs through the existing pending-log rule while leaving `isFileSliceCommitted` unchanged. - Update filesystem-view construction to use the batch API. - Add model and filesystem-view regressions covering out-of-order input and the MOR/NBCC sequence with an inflight first log followed by two completed logs. - No code was copied from another project. ### Impact Snapshot readers retain later committed logs when the earliest physical log in a file group belongs to a failed, uncommitted write. Existing base-file and pending-compaction slices remain authoritative, pending-only groups retain their existing behavior, and V8+ file-level filtering continues to remove the uncommitted log itself. The internal file-group construction API now batches log files through `HoodieFileGroup#addLogFiles`. There are no storage-format, configuration, or expected performance changes. ### Risk Level medium This changes file-slice construction in a shared filesystem-view path. The risk is mitigated by the existing pre-V8 and V8+ slicing coverage plus the new model and filesystem-view regressions. Validation completed with: - `mvn -pl hudi-hadoop-common -am -DskipShade -DskipITs -Dcheckstyle.skip -Drat.skip -Dtest=TestHoodieFileGroup -Dsurefire.failIfNoSpecifiedTests=false test` - `mvn -pl hudi-hadoop-common -am -DskipShade -DskipITs -Dcheckstyle.skip -Drat.skip -Dtest=TestHoodieTableFileSystemView -Dsurefire.failIfNoSpecifiedTests=false test` Together these ran 59 tests with no failures or errors. ### Documentation Update none. This is a correctness fix with no new feature, configuration, default, or storage-format change. ### Contributor's checklist - [x] Read through [contributor's guide](https://hudi.apache.org/contribute/how-to-contribute) - [x] Enough context is provided in the sections above - [x] Adequate tests were added if applicable -- 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]
