danny0405 opened a new pull request, #19659:
URL: https://github.com/apache/hudi/pull/19659

   ### Describe the issue this Pull Request addresses
   
   Closes #19649.
   
   LSM timeline manifest discovery accepted every file starting with 
`manifest_` except files ending in `.tmp`. Immutable HDFS writes now use 
UUID-suffixed temporary files, so a failed close could leave 
`manifest_<version>.<uuid>` behind. Timeline cleaning, or timeline loading 
while `_version_` is unavailable, then attempted to parse the UUID suffix as 
part of the numeric manifest version and failed persistently.
   
   The immutable-file write path also ran its rename logic from a `finally` 
block. A close failure skipped temporary-file cleanup, while a write failure 
followed by a successful close could publish partial content.
   
   ### Summary and Changelog
   
   This change prevents temporary LSM timeline manifests from blocking archival 
and archived-timeline loading after a transient storage failure.
   
   - Accept only finalized LSM manifest names matching 
`manifest_<numeric-version>` and use the same pattern for version parsing.
   - Close immutable files successfully before renaming their temporary paths.
   - Attempt to remove temporary files after write, close, or rename exceptions 
without hiding the primary failure.
   - Add regression coverage for missing-`_version_` fallback with a UUID 
temporary manifest and for immutable-file write/close failures.
   
   No code was copied from another source.
   
   Validation:
   
   - `mvn -Punit-tests -Dtest=TestLSMTimeline,TestHoodieHadoopStorage 
-Dsurefire.failIfNoSpecifiedTests=false -pl hudi-common,hudi-hadoop-common -am 
test -Dcheckstyle.skip=true -Drat.skip=true`
   - `mvn -pl hudi-io,hudi-common,hudi-hadoop-common -am -DskipTests 
-Drat.skip=true org.apache.maven.plugins:maven-checkstyle-plugin:3.6.0:check`
   
   ### Impact
   
   No public API, configuration, or on-disk format changes. Existing 
UUID-suffixed temporary manifests are ignored during discovery, and future 
failed immutable writes make a best-effort cleanup of their temporary paths. 
The successful write path retains the existing create-close-rename behavior 
with no material performance impact.
   
   ### Risk Level
   
   low. The manifest change narrows discovery to the documented finalized 
filename format. The shared immutable-file change only restructures failure 
handling and is covered by injected write- and close-failure tests in addition 
to the existing storage tests.
   
   ### Documentation Update
   
   none.
   
   ### 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]

Reply via email to