Feature: Partial/incomplete transfer resumption (--partial, --partial-dir, --inplace) #174

Closed
opened 2026-07-30 18:30:24 +02:00 by TapTap · 0 comments
Owner

Corresponding rsync flags/behavior:

  • --partial — keep partially transferred files on interruption and resume on next run
  • --partial-dir=DIR — store partial files in a hidden directory instead of alongside destination files
  • --inplace — update destination files in place instead of writing to a temporary file and renaming

Current FastSync behavior:
file_save_to_disk() in src/shared/file.c:129 opens the destination with fopen(path, "wb") and writes directly to the final path. If the transfer is interrupted, the destination is left in a partial/corrupted state and the next run re-transfers from scratch.

Proposed changes:

  • CLI flags: --partial, --partial-dir=<dir>, --inplace
  • Config fields: bool use_partial, char* partial_dir, bool use_inplace
  • Protocol: no wire changes required; purely receiver-side write strategy
  • Implementation:
    • Default: write to <dest>.fastsync.tmp and rename() to final name on success
    • --partial: leave temp file on failure and resume if size matches on next incremental run
    • --partial-dir: write to <partial-dir>/<relative-path>.fastsync.tmp
    • --inplace: open existing file for write and overwrite blocks as they arrive (more complex; lower priority)

Priority: high
Rationale: Resilience over unreliable networks is a core rsync use case. Without partial resume, large-file transfers over WAN are risky.

Acceptance criteria:

  • Interrupting a large-file transfer leaves a resumable partial file when --partial is used
  • Next invocation resumes from the partial file size when --incremental + --partial are combined
  • --partial-dir isolates temp files from the destination tree
  • Integration tests cover interruption and resume scenarios
**Corresponding rsync flags/behavior:** - `--partial` — keep partially transferred files on interruption and resume on next run - `--partial-dir=DIR` — store partial files in a hidden directory instead of alongside destination files - `--inplace` — update destination files in place instead of writing to a temporary file and renaming **Current FastSync behavior:** `file_save_to_disk()` in `src/shared/file.c:129` opens the destination with `fopen(path, "wb")` and writes directly to the final path. If the transfer is interrupted, the destination is left in a partial/corrupted state and the next run re-transfers from scratch. **Proposed changes:** - CLI flags: `--partial`, `--partial-dir=<dir>`, `--inplace` - Config fields: `bool use_partial`, `char* partial_dir`, `bool use_inplace` - Protocol: no wire changes required; purely receiver-side write strategy - Implementation: - Default: write to `<dest>.fastsync.tmp` and `rename()` to final name on success - `--partial`: leave temp file on failure and resume if size matches on next incremental run - `--partial-dir`: write to `<partial-dir>/<relative-path>.fastsync.tmp` - `--inplace`: open existing file for write and overwrite blocks as they arrive (more complex; lower priority) **Priority:** high **Rationale:** Resilience over unreliable networks is a core rsync use case. Without partial resume, large-file transfers over WAN are risky. **Acceptance criteria:** - [ ] Interrupting a large-file transfer leaves a resumable partial file when `--partial` is used - [ ] Next invocation resumes from the partial file size when `--incremental` + `--partial` are combined - [ ] `--partial-dir` isolates temp files from the destination tree - [ ] Integration tests cover interruption and resume scenarios
TapTap added the enhancementneeds-triage labels 2026-07-30 18:30:24 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TapTap/FastSync#174