Repository navigation
Avoid checksum comparisons when timestamps match - #2068
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return false; | ||
| } | ||
|
|
||
| if !checksum && !size_only && modify_window.is_zero() && src == dst { | ||
| return files_checksum_match(source_path, destination_path, checksum_algorithm) | ||
| .unwrap_or(false); | ||
| } | ||
|
|
||
| true |
There was a problem hiding this comment.
Preserve content verification when mtimes match
After the change, should_skip_copy returns true as soon as the source and destination mtimes fall within the modify window, even when modify_window is zero and both files have identical timestamps. Without the previous checksum guard, two files with the same size and synchronized mtimes but different contents (e.g., someone edits the file and then runs touch -r) will be treated as identical unless --checksum is explicitly requested, causing the stale destination to be left untouched. The repository already has tests such as should_skip_copy_detects_content_changes_with_identical_timestamps that relied on the checksum comparison to prevent this situation, so this regression will skip copying modified files.
Useful? React with 👍 / 👎.
…nsport (#1938) (#3525) Formalizes the SSH stdio transport audit at docs/audits/ssh-socketpair-vs-pipes.md under tracker #1938, consolidating prior #1686 working notes (PR #3438), the io_uring boundary documented for #1858 (PR #3418), and the stderr socketpair shipped under #1689 (PR #3383). Restructures the document into the formal seven-section layout (summary, upstream reference, current implementation, trade-offs, decision matrix, recommendation, implementation notes) plus findings and references. Recommends keeping anonymous pipes for the SSH wire and not pursuing the socketpair migration: splice(2) and vmsplice(2) require a pipe end, the zero-copy plan in #1860 depends on that, and the unified-FD argument is subsumed by the async-transport refactor (#2068, #1655). Closes #1687 (prototype socketpair wire) as do-not-implement and #1902 (verify wire claim against rsync_io source) as verified. Citations were re-checked against worktree source: builder.rs:300-301 (Stdio::piped on the wire), aux_channel.rs:263-285 (UnixStream::pair for stderr, Unix only), connection.rs:30-39 (SshConnection struct), mod.rs:57-75 (io_uring boundary). Upstream evidence verified against target/interop/upstream-src/rsync-3.4.1/: pipe.c:48-97 (piped_child), util1.c:74-96 (fd_pair), main.c:504-663 (do_cmd dispatch), clientserver.c:116-148 (daemon TCP wire), socket.c:736-846 (sock_exec test escape).
…nsport (#1938) (#3525) Formalizes the SSH stdio transport audit at docs/audits/ssh-socketpair-vs-pipes.md under tracker #1938, consolidating prior #1686 working notes (PR #3438), the io_uring boundary documented for #1858 (PR #3418), and the stderr socketpair shipped under #1689 (PR #3383). Restructures the document into the formal seven-section layout (summary, upstream reference, current implementation, trade-offs, decision matrix, recommendation, implementation notes) plus findings and references. Recommends keeping anonymous pipes for the SSH wire and not pursuing the socketpair migration: splice(2) and vmsplice(2) require a pipe end, the zero-copy plan in #1860 depends on that, and the unified-FD argument is subsumed by the async-transport refactor (#2068, #1655). Closes #1687 (prototype socketpair wire) as do-not-implement and #1902 (verify wire claim against rsync_io source) as verified. Citations were re-checked against worktree source: builder.rs:300-301 (Stdio::piped on the wire), aux_channel.rs:263-285 (UnixStream::pair for stderr, Unix only), connection.rs:30-39 (SshConnection struct), mod.rs:57-75 (io_uring boundary). Upstream evidence verified against target/interop/upstream-src/rsync-3.4.1/: pipe.c:48-97 (piped_child), util1.c:74-96 (fd_pair), main.c:504-663 (do_cmd dispatch), clientserver.c:116-148 (daemon TCP wire), socket.c:736-846 (sock_exec test escape).
…tness (#3644) Sub-design for the prune insertion point of `docs/design/zsync-inspired-matching.md` (#2068, blocking impl #2069, proptest #2070, benchmark #2071). Covers what zsync does at write_blocks (rsum.c:109-119) and how oc-rsync mirrors it inside crates/match/. Pins the insertion to the inner-loop COPY emit at generator.rs:214. Specifies the MatchedBlocks bitmap (1 bit per signature block, 128 B at 1k blocks, 12.5 MB at 100M), placement alongside DeltaSignatureIndex, and the extended probe order (bithash -> tag_table -> bucket lookup -> bitmap filter -> strong-checksum). Spells out duplicate-bucket correctness with a worked example, the property-test contract, and the bench corpora (VM disk images, log tarballs, synthetic). Restates the wire-compat invariants and the no-CLI/no-protocol cleanup contract.
…#3933) Document the four wire-compatible zsync-inspired matching speedups (bithash prefilter #2059-2062, seq-match extend-run #2064-2066, matched-block pruning #2068-2070, compact-keys layout #2072-2073) with CHANGELOG snippets, a release notes block, an anti-spec forbidding wire-feature advertisement, and a placeholder for benchmark numbers pending #2081 and #2082.
…tness (#3644) Sub-design for the prune insertion point of `docs/design/zsync-inspired-matching.md` (#2068, blocking impl #2069, proptest #2070, benchmark #2071). Covers what zsync does at write_blocks (rsum.c:109-119) and how oc-rsync mirrors it inside crates/match/. Pins the insertion to the inner-loop COPY emit at generator.rs:214. Specifies the MatchedBlocks bitmap (1 bit per signature block, 128 B at 1k blocks, 12.5 MB at 100M), placement alongside DeltaSignatureIndex, and the extended probe order (bithash -> tag_table -> bucket lookup -> bitmap filter -> strong-checksum). Spells out duplicate-bucket correctness with a worked example, the property-test contract, and the bench corpora (VM disk images, log tarballs, synthetic). Restates the wire-compat invariants and the no-CLI/no-protocol cleanup contract.
…#3933) Document the four wire-compatible zsync-inspired matching speedups (bithash prefilter #2059-2062, seq-match extend-run #2064-2066, matched-block pruning #2068-2070, compact-keys layout #2072-2073) with CHANGELOG snippets, a release notes block, an anti-spec forbidding wire-feature advertisement, and a placeholder for benchmark numbers pending #2081 and #2082.
…tness (#3644) Sub-design for the prune insertion point of `docs/design/zsync-inspired-matching.md` (#2068, blocking impl #2069, proptest #2070, benchmark #2071). Covers what zsync does at write_blocks (rsum.c:109-119) and how oc-rsync mirrors it inside crates/match/. Pins the insertion to the inner-loop COPY emit at generator.rs:214. Specifies the MatchedBlocks bitmap (1 bit per signature block, 128 B at 1k blocks, 12.5 MB at 100M), placement alongside DeltaSignatureIndex, and the extended probe order (bithash -> tag_table -> bucket lookup -> bitmap filter -> strong-checksum). Spells out duplicate-bucket correctness with a worked example, the property-test contract, and the bench corpora (VM disk images, log tarballs, synthetic). Restates the wire-compat invariants and the no-CLI/no-protocol cleanup contract.
…#3933) Document the four wire-compatible zsync-inspired matching speedups (bithash prefilter #2059-2062, seq-match extend-run #2064-2066, matched-block pruning #2068-2070, compact-keys layout #2072-2073) with CHANGELOG snippets, a release notes block, an anti-spec forbidding wire-feature advertisement, and a placeholder for benchmark numbers pending #2081 and #2082.
Summary
Testing
[Codex Task](