Repository navigation
feat: add HardlinkApplyTracker for receiver-side hardlink restoration - #3048
Merged
Merged
Conversation
Implement protocol-aware hardlink tracking for creating hard links at file apply time using std::fs::hard_link(). Mirrors upstream hlink.c:finish_hard_link() and hlink.c:hard_link_check(). - HardlinkApplyTracker tracks leaders by hardlink_idx (gnum) and creates links for followers or defers them when leader is pending - record_leader() returns deferred followers for immediate linking - apply_follower() creates link or defers based on leader availability - resolve_deferred() final pass for remaining deferred followers - Handles parent dir creation, existing file replacement, cross-dir links - Export XMIT_HLINKED and XMIT_HLINK_FIRST from protocol crate - Add 15 engine tests and 10 receiver integration tests
oferchen
added a commit
that referenced
this pull request
May 1, 2026
…#3048) * feat: add HardlinkApplyTracker for receiver-side hardlink restoration Implement protocol-aware hardlink tracking for creating hard links at file apply time using std::fs::hard_link(). Mirrors upstream hlink.c:finish_hard_link() and hlink.c:hard_link_check(). - HardlinkApplyTracker tracks leaders by hardlink_idx (gnum) and creates links for followers or defers them when leader is pending - record_leader() returns deferred followers for immediate linking - apply_follower() creates link or defers based on leader availability - resolve_deferred() final pass for remaining deferred followers - Handles parent dir creation, existing file replacement, cross-dir links - Export XMIT_HLINKED and XMIT_HLINK_FIRST from protocol crate - Add 15 engine tests and 10 receiver integration tests * style: fix rustfmt formatting in hardlink tracker and flist exports * style: fix edition 2024 import ordering across hardlink tracker files
oferchen
added a commit
that referenced
this pull request
May 5, 2026
…#3048) * feat: add HardlinkApplyTracker for receiver-side hardlink restoration Implement protocol-aware hardlink tracking for creating hard links at file apply time using std::fs::hard_link(). Mirrors upstream hlink.c:finish_hard_link() and hlink.c:hard_link_check(). - HardlinkApplyTracker tracks leaders by hardlink_idx (gnum) and creates links for followers or defers them when leader is pending - record_leader() returns deferred followers for immediate linking - apply_follower() creates link or defers based on leader availability - resolve_deferred() final pass for remaining deferred followers - Handles parent dir creation, existing file replacement, cross-dir links - Export XMIT_HLINKED and XMIT_HLINK_FIRST from protocol crate - Add 15 engine tests and 10 receiver integration tests * style: fix rustfmt formatting in hardlink tracker and flist exports * style: fix edition 2024 import ordering across hardlink tracker files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
HardlinkApplyTrackerto engine crate for protocol-aware hardlink restoration at file apply timehardlink_idx(gnum), createsstd::fs::hard_link()for followers or defers when leader is pendingrecord_leader()returns deferred followers for immediate linking after leader completesresolve_deferred()final pass handles remaining followers (upstream:hlink.c:finish_hard_link())XMIT_HLINKEDandXMIT_HLINK_FIRSTconstants from protocol crate for test constructionTest plan
create_hardlinks()post-transfer pass#[cfg(unix)]