mirror of
https://github.com/rclone/rclone.git
synced 2024-12-21 19:16:29 +08:00
fd95511091
Before this change, bisync needed to build a full listing for Path1, then a full listing for Path2, then compare them -- and each of those tasks needed to finish before the next one could start. In addition to being slow and inefficient, it also caused real problems if a file changed between the time bisync checked it on Path1 and the time it checked the corresponding file on Path2. This change solves these problems by listing both paths concurrently, using the same March infrastructure that check and sync use to traverse two directories in lock-step, optimized by Go's robust concurrency support. Listings should now be much faster, and any given path is now checked nearly-instantaneously on both sides, minimizing room for error. Further discussion: https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=4.%20Listings%20should%20alternate%20between%20paths%20to%20minimize%20errors
10 KiB
10 KiB
(01) : test dry-run
(02) : test initial bisync
(03) : bisync resync
INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"
INFO : Copying unique Path2 files to Path1
INFO : Resynching Path1 to Path2
INFO : Resync updating listings
INFO : Bisync successful
(04) : test new on path2 - file10
(05) : touch-copy 2001-01-02 {datadir/}file10.txt {path2/}
(06) : test newer on path2 - file1
(07) : touch-copy 2001-01-02 {datadir/}file1.txt {path2/}
(08) : test new on path1 - file11
(09) : touch-copy 2001-01-02 {datadir/}file11.txt {path1/}
(10) : test newer on path1 - file2
(11) : touch-copy 2001-01-02 {datadir/}file2.txt {path1/}
(12) : test deleted on path2 - file3
(13) : delete-file {path2/}file3.txt
(14) : test deleted on path1 - file4
(15) : delete-file {path1/}file4.txt
(16) : test changed on path2 and on path1 - file5 (file5R, file5L)
(17) : touch-glob 2001-01-02 {datadir/} file5R.txt
(18) : copy-as {datadir/}file5R.txt {path2/} file5.txt
(19) : touch-glob 2001-03-04 {datadir/} file5L.txt
(20) : copy-as {datadir/}file5L.txt {path1/} file5.txt
(21) : test newer on path2 and deleted on path1 - file6
(22) : touch-copy 2001-01-02 {datadir/}file6.txt {path2/}
(23) : delete-file {path1/}file6.txt
(24) : test newer on path1 and deleted on path2 - file7
(25) : touch-copy 2001-01-02 {datadir/}file7.txt {path1/}
(26) : delete-file {path2/}file7.txt
(27) : test sync with dry-run and resync
(28) : bisync dry-run resync
INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"
INFO : Copying unique Path2 files to Path1
INFO : - Path2 Resync will copy to Path1 - file10.txt
INFO : - Path2 Resync will copy to Path1 - file4.txt
INFO : - Path2 Resync will copy to Path1 - file6.txt
INFO : - Path2 Resync is doing queued copies to - Path1
NOTICE: file10.txt: Skipped copy as --dry-run is set (size 19)
NOTICE: file4.txt: Skipped copy as --dry-run is set (size 0)
NOTICE: file6.txt: Skipped copy as --dry-run is set (size 19)
INFO : Resynching Path1 to Path2
NOTICE: file1.txt: Skipped copy as --dry-run is set (size 0)
NOTICE: file11.txt: Skipped copy as --dry-run is set (size 19)
NOTICE: file2.txt: Skipped copy as --dry-run is set (size 13)
NOTICE: file3.txt: Skipped copy as --dry-run is set (size 0)
NOTICE: file5.txt: Skipped copy (or update modification time) as --dry-run is set (size 39)
NOTICE: file7.txt: Skipped copy as --dry-run is set (size 19)
INFO : Resync updating listings
INFO : Bisync successful
(29) : copy-listings dryrun-resync
(30) : test sync with dry-run
(31) : bisync dry-run
INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"
INFO : Building Path1 and Path2 listings
INFO : Path1 checking for diffs
INFO : - Path1 File is newer - file2.txt
INFO : - Path1 File was deleted - file4.txt
INFO : - Path1 File is newer - file5.txt
INFO : - Path1 File was deleted - file6.txt
INFO : - Path1 File is newer - file7.txt
INFO : - Path1 File is new - file11.txt
INFO : Path1: 6 changes: 1 new, 3 newer, 0 older, 2 deleted
INFO : Path2 checking for diffs
INFO : - Path2 File is newer - file1.txt
INFO : - Path2 File was deleted - file3.txt
INFO : - Path2 File is newer - file5.txt
INFO : - Path2 File is newer - file6.txt
INFO : - Path2 File was deleted - file7.txt
INFO : - Path2 File is new - file10.txt
INFO : Path2: 6 changes: 1 new, 3 newer, 0 older, 2 deleted
INFO : Applying changes
INFO : Checking potential conflicts...
ERROR : file5.txt: md5 differ
NOTICE: Local file system at {path2}: 1 differences found
NOTICE: Local file system at {path2}: 1 errors while checking
INFO : Finished checking the potential conflicts. 1 differences found
INFO : - Path1 Queue copy to Path2 - {path2/}file11.txt
INFO : - Path1 Queue copy to Path2 - {path2/}file2.txt
INFO : - Path2 Queue delete - {path2/}file4.txt
NOTICE: - WARNING New or changed in both paths - file5.txt
NOTICE: - Path1 Renaming Path1 copy - {path1/}file5.txt..path1
NOTICE: file5.txt: Skipped move as --dry-run is set (size 39)
NOTICE: - Path1 Queue copy to Path2 - {path2/}file5.txt..path1
NOTICE: - Path2 Renaming Path2 copy - {path2/}file5.txt..path2
NOTICE: file5.txt: Skipped move as --dry-run is set (size 39)
NOTICE: - Path2 Queue copy to Path1 - {path1/}file5.txt..path2
INFO : - Path2 Queue copy to Path1 - {path1/}file6.txt
INFO : - Path1 Queue copy to Path2 - {path2/}file7.txt
INFO : - Path2 Queue copy to Path1 - {path1/}file1.txt
INFO : - Path2 Queue copy to Path1 - {path1/}file10.txt
INFO : - Path1 Queue delete - {path1/}file3.txt
INFO : - Path2 Do queued copies to - Path1
NOTICE: file1.txt: Skipped copy as --dry-run is set (size 19)
NOTICE: file10.txt: Skipped copy as --dry-run is set (size 19)
NOTICE: file3.txt: Skipped delete as --dry-run is set (size 0)
NOTICE: file6.txt: Skipped copy as --dry-run is set (size 19)
INFO : - Path1 Do queued copies to - Path2
NOTICE: file11.txt: Skipped copy as --dry-run is set (size 19)
NOTICE: file2.txt: Skipped copy as --dry-run is set (size 13)
NOTICE: file4.txt: Skipped delete as --dry-run is set (size 0)
NOTICE: file7.txt: Skipped copy as --dry-run is set (size 19)
INFO : Updating listings
INFO : Bisync successful
(32) : copy-listings dryrun
(33) : test sync without dry-run
(34) : bisync
INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"
INFO : Building Path1 and Path2 listings
INFO : Path1 checking for diffs
INFO : - Path1 File is newer - file2.txt
INFO : - Path1 File was deleted - file4.txt
INFO : - Path1 File is newer - file5.txt
INFO : - Path1 File was deleted - file6.txt
INFO : - Path1 File is newer - file7.txt
INFO : - Path1 File is new - file11.txt
INFO : Path1: 6 changes: 1 new, 3 newer, 0 older, 2 deleted
INFO : Path2 checking for diffs
INFO : - Path2 File is newer - file1.txt
INFO : - Path2 File was deleted - file3.txt
INFO : - Path2 File is newer - file5.txt
INFO : - Path2 File is newer - file6.txt
INFO : - Path2 File was deleted - file7.txt
INFO : - Path2 File is new - file10.txt
INFO : Path2: 6 changes: 1 new, 3 newer, 0 older, 2 deleted
INFO : Applying changes
INFO : Checking potential conflicts...
ERROR : file5.txt: md5 differ
NOTICE: Local file system at {path2}: 1 differences found
NOTICE: Local file system at {path2}: 1 errors while checking
INFO : Finished checking the potential conflicts. 1 differences found
INFO : - Path1 Queue copy to Path2 - {path2/}file11.txt
INFO : - Path1 Queue copy to Path2 - {path2/}file2.txt
INFO : - Path2 Queue delete - {path2/}file4.txt
NOTICE: - WARNING New or changed in both paths - file5.txt
NOTICE: - Path1 Renaming Path1 copy - {path1/}file5.txt..path1
NOTICE: - Path1 Queue copy to Path2 - {path2/}file5.txt..path1
NOTICE: - Path2 Renaming Path2 copy - {path2/}file5.txt..path2
NOTICE: - Path2 Queue copy to Path1 - {path1/}file5.txt..path2
INFO : - Path2 Queue copy to Path1 - {path1/}file6.txt
INFO : - Path1 Queue copy to Path2 - {path2/}file7.txt
INFO : - Path2 Queue copy to Path1 - {path1/}file1.txt
INFO : - Path2 Queue copy to Path1 - {path1/}file10.txt
INFO : - Path1 Queue delete - {path1/}file3.txt
INFO : - Path2 Do queued copies to - Path1
INFO : - Path1 Do queued copies to - Path2
INFO : Updating listings
INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"
INFO : Bisync successful
(02) : test initial bisync
(03) : bisync resync
INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"
INFO : Copying unique Path2 files to Path1
INFO : Resynching Path1 to Path2
INFO : Resync updating listings
INFO : Bisync successful
(04) : test new on path2 - file10
(05) : touch-copy 2001-01-02 {datadir/}file10.txt {path2/}
(06) : test newer on path2 - file1
(07) : touch-copy 2001-01-02 {datadir/}file1.txt {path2/}
(08) : test new on path1 - file11
(09) : touch-copy 2001-01-02 {datadir/}file11.txt {path1/}
(10) : test newer on path1 - file2
(11) : touch-copy 2001-01-02 {datadir/}file2.txt {path1/}
(12) : test deleted on path2 - file3
(13) : delete-file {path2/}file3.txt
(14) : test deleted on path1 - file4
(15) : delete-file {path1/}file4.txt
(16) : test changed on path2 and on path1 - file5 (file5R, file5L)
(17) : touch-glob 2001-01-02 {datadir/} file5R.txt
(18) : copy-as {datadir/}file5R.txt {path2/} file5.txt
(19) : touch-glob 2001-03-04 {datadir/} file5L.txt
(20) : copy-as {datadir/}file5L.txt {path1/} file5.txt
(21) : test newer on path2 and deleted on path1 - file6
(22) : touch-copy 2001-01-02 {datadir/}file6.txt {path2/}
(23) : delete-file {path1/}file6.txt
(24) : test newer on path1 and deleted on path2 - file7
(25) : touch-copy 2001-01-02 {datadir/}file7.txt {path1/}
(26) : delete-file {path2/}file7.txt
(27) : test sync with dry-run and resync
(28) : bisync dry-run resync
INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"
INFO : Copying unique Path2 files to Path1
INFO : - Path2 Resync will copy to Path1 - file10.txt
INFO : - Path2 Resync will copy to Path1 - file4.txt
INFO : - Path2 Resync will copy to Path1 - file6.txt
INFO : - Path2 Resync is doing queued copies to - Path1
NOTICE: file10.txt: Skipped copy as --dry-run is set (size 19)
NOTICE: file4.txt: Skipped copy as --dry-run is set (size 0)
NOTICE: file6.txt: Skipped copy as --dry-run is set (size 19)
INFO : Resynching Path1 to Path2
NOTICE: file1.txt: Skipped copy as --dry-run is set (size 0)
NOTICE: file11.txt: Skipped copy as --dry-run is set (size 19)
NOTICE: file2.txt: Skipped copy as --dry-run is set (size 13)
NOTICE: file3.txt: Skipped copy as --dry-run is set (size 0)
NOTICE: file5.txt: Skipped copy (or update modification time) as --dry-run is set (size 39)
NOTICE: file7.txt: Skipped copy as --dry-run is set (size 19)
INFO : Resync updating listings
INFO : Bisync successful
(29) : copy-listings dryrun-resync
(30) : test sync with dry-run
(31) : bisync dry-run
INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"
INFO : Building Path1 and Path2 listings
INFO : Path1 checking for diffs
INFO : - Path1 File is newer - file2.txt
INFO : - Path1 File was deleted - file4.txt
INFO : - Path1 File is newer - file5.txt
INFO : - Path1 File was deleted - file6.txt
INFO : - Path1 File is newer - file7.txt
INFO : - Path1 File is new - file11.txt
INFO : Path1: 6 changes: 1 new, 3 newer, 0 older, 2 deleted
INFO : Path2 checking for diffs
INFO : - Path2 File is newer - file1.txt
INFO : - Path2 File was deleted - file3.txt
INFO : - Path2 File is newer - file5.txt
INFO : - Path2 File is newer - file6.txt
INFO : - Path2 File was deleted - file7.txt
INFO : - Path2 File is new - file10.txt
INFO : Path2: 6 changes: 1 new, 3 newer, 0 older, 2 deleted
INFO : Applying changes
INFO : Checking potential conflicts...
ERROR : file5.txt: md5 differ
NOTICE: Local file system at {path2}: 1 differences found
NOTICE: Local file system at {path2}: 1 errors while checking
INFO : Finished checking the potential conflicts. 1 differences found
INFO : - Path1 Queue copy to Path2 - {path2/}file11.txt
INFO : - Path1 Queue copy to Path2 - {path2/}file2.txt
INFO : - Path2 Queue delete - {path2/}file4.txt
NOTICE: - WARNING New or changed in both paths - file5.txt
NOTICE: - Path1 Renaming Path1 copy - {path1/}file5.txt..path1
NOTICE: file5.txt: Skipped move as --dry-run is set (size 39)
NOTICE: - Path1 Queue copy to Path2 - {path2/}file5.txt..path1
NOTICE: - Path2 Renaming Path2 copy - {path2/}file5.txt..path2
NOTICE: file5.txt: Skipped move as --dry-run is set (size 39)
NOTICE: - Path2 Queue copy to Path1 - {path1/}file5.txt..path2
INFO : - Path2 Queue copy to Path1 - {path1/}file6.txt
INFO : - Path1 Queue copy to Path2 - {path2/}file7.txt
INFO : - Path2 Queue copy to Path1 - {path1/}file1.txt
INFO : - Path2 Queue copy to Path1 - {path1/}file10.txt
INFO : - Path1 Queue delete - {path1/}file3.txt
INFO : - Path2 Do queued copies to - Path1
NOTICE: file1.txt: Skipped copy as --dry-run is set (size 19)
NOTICE: file10.txt: Skipped copy as --dry-run is set (size 19)
NOTICE: file3.txt: Skipped delete as --dry-run is set (size 0)
NOTICE: file6.txt: Skipped copy as --dry-run is set (size 19)
INFO : - Path1 Do queued copies to - Path2
NOTICE: file11.txt: Skipped copy as --dry-run is set (size 19)
NOTICE: file2.txt: Skipped copy as --dry-run is set (size 13)
NOTICE: file4.txt: Skipped delete as --dry-run is set (size 0)
NOTICE: file7.txt: Skipped copy as --dry-run is set (size 19)
INFO : Updating listings
INFO : Bisync successful
(32) : copy-listings dryrun
(33) : test sync without dry-run
(34) : bisync
INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"
INFO : Building Path1 and Path2 listings
INFO : Path1 checking for diffs
INFO : - Path1 File is newer - file2.txt
INFO : - Path1 File was deleted - file4.txt
INFO : - Path1 File is newer - file5.txt
INFO : - Path1 File was deleted - file6.txt
INFO : - Path1 File is newer - file7.txt
INFO : - Path1 File is new - file11.txt
INFO : Path1: 6 changes: 1 new, 3 newer, 0 older, 2 deleted
INFO : Path2 checking for diffs
INFO : - Path2 File is newer - file1.txt
INFO : - Path2 File was deleted - file3.txt
INFO : - Path2 File is newer - file5.txt
INFO : - Path2 File is newer - file6.txt
INFO : - Path2 File was deleted - file7.txt
INFO : - Path2 File is new - file10.txt
INFO : Path2: 6 changes: 1 new, 3 newer, 0 older, 2 deleted
INFO : Applying changes
INFO : Checking potential conflicts...
ERROR : file5.txt: md5 differ
NOTICE: Local file system at {path2}: 1 differences found
NOTICE: Local file system at {path2}: 1 errors while checking
INFO : Finished checking the potential conflicts. 1 differences found
INFO : - Path1 Queue copy to Path2 - {path2/}file11.txt
INFO : - Path1 Queue copy to Path2 - {path2/}file2.txt
INFO : - Path2 Queue delete - {path2/}file4.txt
NOTICE: - WARNING New or changed in both paths - file5.txt
NOTICE: - Path1 Renaming Path1 copy - {path1/}file5.txt..path1
NOTICE: - Path1 Queue copy to Path2 - {path2/}file5.txt..path1
NOTICE: - Path2 Renaming Path2 copy - {path2/}file5.txt..path2
NOTICE: - Path2 Queue copy to Path1 - {path1/}file5.txt..path2
INFO : - Path2 Queue copy to Path1 - {path1/}file6.txt
INFO : - Path1 Queue copy to Path2 - {path2/}file7.txt
INFO : - Path2 Queue copy to Path1 - {path1/}file1.txt
INFO : - Path2 Queue copy to Path1 - {path1/}file10.txt
INFO : - Path1 Queue delete - {path1/}file3.txt
INFO : - Path2 Do queued copies to - Path1
INFO : - Path1 Do queued copies to - Path2
INFO : Updating listings
INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"
INFO : Bisync successful