Skip to content

Archivation seems to send the file multiple times via rsync #488

Open
@ceecko

Description

@ceecko

Describe the bug
The plot_util.py returns a list of completed k32 plots in list_k32_plots
It checks the size by validating if file_size > 0.95 * k32_size in https://github.com/ericaltendorf/plotman/blob/main/src/plotman/plot_util.py#L55

Since there's still 5% (~5GB) to be written, Chia can still be writing to the file.
The rsync process is started though regardless if Chia is still writing.
Rsync behavior with --remove-source-files is that the source file is not removed if the file has changed during the file transfer.
With simulation, I ran the rsync command 3 times in a row, the following errors are produced:

$ rsync -P -r --bwlimit=10000 --remove-source-files fromdir/ todir/
sending incremental file list
a.txt
    107,028,047 100%    9.84MB/s    0:00:10 (xfr#1, to-chk=0/2)
rsync: read errors mapping "/tmp/rsync/fromdir/a.txt": No data available (61)
WARNING: a.txt failed verification -- update discarded (will try again).
a.txt
    107,028,059 100%    9.75MB/s    0:00:10 (xfr#2, to-chk=0/2)
ERROR: Skipping sender remove for changed file: a.txt
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1207) [sender=3.1.3]

$ rsync -P -r --bwlimit=10000 --remove-source-files fromdir/ todir/
sending incremental file list
a.txt
    107,028,059 100%    9.79MB/s    0:00:10 (xfr#1, to-chk=0/2)

$ rsync -P -r --bwlimit=10000 --remove-source-files fromdir/ todir/
sending incremental file list

It appears the destination file will be moved 3 times which is quite a lot for a 108GB file.
Two times during the first rsync.
Once during the second rsync since the first rsync did not delete the source file.

This ticket is more about understanding why 0.95 constant is being used. Maybe there's a very good reason which I may not be aware of.

Expected behavior
Rsync should transfer the file only once

System setup:

  • OS: Ubuntu 20.04
  • rsync

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions