hfutatzhanghb opened a new pull request, #7811:
URL: https://github.com/apache/opendal/pull/7811

   # Which issue does this PR close?
   
   N/A.
   
   # Rationale for this change
   
   Transactional writers such as Lance need an atomic rename-if-not-exists 
operation to publish manifests without overwriting a concurrent commit. HDFS 
can provide this behavior when linked against a newer system `libhdfs` whose 
`hdfsRename` uses the `rename2` semantics introduced by HDFS-3592.
   
   # What changes are included in this PR?
   
   - Add `RenameOptions`, `rename_with`, and `rename_options` APIs, including 
the blocking variant.
   - Add `rename_with_if_not_exists` capability validation and behavior tests.
   - Implement conditional rename for HDFS without deleting or retrying the 
destination.
   - Map native `AlreadyExists` directly and limit the legacy post-failure 
compatibility check to `EIO`.
   - Add an HDFS builder/config opt-in because bundled and older `libhdfs` 
versions do not provide safe atomic semantics.
   
   Validation performed:
   
   - `cargo test -p opendal-core --test rename`
   - Focused correctness and capability-check layer tests
   - `cargo test -p opendal-service-hdfs --lib`
   - `cargo test --test behavior --features tests,services-hdfs --no-run`
   - Focused Clippy checks with warnings denied
   - `cargo fmt --all -- --check`
   
   A live compatible HDFS fixture was not available, so the HDFS behavior suite 
was compiled but not executed against a cluster.
   
   # Are there any user-facing changes?
   
   Yes. Rust callers can request rename-if-not-exists through rename options. 
HDFS users must explicitly call `Hdfs::enable_rename_if_not_exists(true)` and 
must only do so when using a compatible newer system `libhdfs`; the default 
remains disabled.
   
   # AI Usage Statement
   
   AI assistance was used during implementation, testing, and review.
   


-- 
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