You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
looking at the code there is a lot of work to copy Path2 files not in Path1, and then do an "rclone sync" from Path1 to Path2. Why don't you just do and "rclone copy" from Path1 to Path2, and then an "rclone copy" from Path2 to Path1?
This is much simpler, there is no need to read 2 times LSL files and to loop for missing Path2 files, and the result should be the same. Am i missing something?
The first-sync optimization is deferred for now since its not broke and should be rarely run.
I think the core question here is whether rclonesync's asymmetrical --first-sync solves some subtle problem. I think the answer is no, none that I can recall. When I implemented the current --first-sync method I think I was too embedded in the new algorithm (building file lists for raw copies/deletes) that I missed the simpler picture. I'd say go for this method...
I tend to think it would be better to change it, as in addition to being simpler and more symmetrical, it would also make --resync substantially faster for users of --create-empty-src-dirs. However, it would be a breaking change, and I'm not sure how concerned we should be about that. It's possible that some users have come to depend on the asymmetry in some way. For instance, imagine a scenario where you're bisyncing one central server with multiple devices, and the server is the source-of-truth. The asymmetry allows you to declare that the server should take priority in the event of a --resync, even if the corresponding file on the other path is newer.
Perhaps the best compromise is to make the behavior configurable with a flag?
I generally agree as well, although I have a slight concern about the use of --update for the same reasons articulated in our other thread, about the potential dangers of picking winners and losers at the file level instead of the filesystem level. But I think this could be solved by just letting the user choose their desired behavior with a flag.
This also makes a --resync far less destructive. Currently, Path1 will always take precedent which is the last thing I believe anyone would want from a bisync
I can think of a few reasons a user might want the asymmetry -- I described one of them above. Imagine, for example, that I pull my dusty old laptop out of the closet which hasn't been synced in a long time, and I want to bring it up to date with my Google Drive which I know is totally up-to-date. In this case, I do in fact want the trusted drive side to take precedence over the untrusted local side -- even if certain local files happen to be newer (intentional reversions do sometimes happen -- maybe I restored something from a backup recently on the drive side, and now it's about to get overwritten.) An asymmetrical --resync lets you declare one side the source-of-truth; while --update prioritizes the newness of individual files, possibly at the expense of consistency at the directory-level.
Another use case (which I've used myself) is safer preservation of metadata that rclone doesn't currently support, such as directory metadata, macOS xattrs, and permissions. An asymmetrical sync allows you to avoid overwriting that stuff on the trusted side, when possible.
Additionally, it should be noted that bisync's current approximation of --ignore-existing does have a performance benefit, because in 1 of the 2 directions it can skip the modtime (or checksum) check for some of the files. (But that performance benefit is negated if using --create-empty-src-dirs, which requires a third operation -- unless we change that.)
I tend to think that rclone's default (which is still slightly asymmetrical) should be bisync's default:
but that this should be overridable with flags for users who think this is madness 😄
@ncw I think this is ultimately a question for you -- what is your guiding principle for breaking changes such as this, where it's not exactly a bug, but there does seem to be consensus that a different way would be better? Is it ok to change the behavior, provided it's documented clearly? (And is the calculation different because bisync is still in beta?)
Activity
cjnaz commentedon Oct 8, 2021
I think the core question here is whether rclonesync's asymmetrical --first-sync solves some subtle problem. I think the answer is no, none that I can recall. When I implemented the current --first-sync method I think I was too embedded in the new algorithm (building file lists for raw copies/deletes) that I missed the simpler picture. I'd say go for this method...
ivandeex commentedon Oct 8, 2021
Unit tests and documentation will be updated respectively.
bisync: bug fixes and new features including --create-empty-src-dirs …
nielash commentedon Aug 21, 2023
I had the same thought recently:
rclone/cmd/bisync/operations.go
Lines 426 to 433 in 156c372
I tend to think it would be better to change it, as in addition to being simpler and more symmetrical, it would also make
--resyncsubstantially faster for users of--create-empty-src-dirs. However, it would be a breaking change, and I'm not sure how concerned we should be about that. It's possible that some users have come to depend on the asymmetry in some way. For instance, imagine a scenario where you're bisyncing one central server with multiple devices, and the server is the source-of-truth. The asymmetry allows you to declare that the server should take priority in the event of a--resync, even if the corresponding file on the other path is newer.Perhaps the best compromise is to make the behavior configurable with a flag?
nielash commentedon Sep 30, 2023
I generally agree as well, although I have a slight concern about the use of
--updatefor the same reasons articulated in our other thread, about the potential dangers of picking winners and losers at the file level instead of the filesystem level. But I think this could be solved by just letting the user choose their desired behavior with a flag.I can think of a few reasons a user might want the asymmetry -- I described one of them above. Imagine, for example, that I pull my dusty old laptop out of the closet which hasn't been synced in a long time, and I want to bring it up to date with my Google Drive which I know is totally up-to-date. In this case, I do in fact want the trusted
driveside to take precedence over the untrustedlocalside -- even if certainlocalfiles happen to be newer (intentional reversions do sometimes happen -- maybe I restored something from a backup recently on thedriveside, and now it's about to get overwritten.) An asymmetrical--resynclets you declare one side the source-of-truth; while--updateprioritizes the newness of individual files, possibly at the expense of consistency at the directory-level.Another use case (which I've used myself) is safer preservation of metadata that rclone doesn't currently support, such as directory metadata, macOS xattrs, and permissions. An asymmetrical sync allows you to avoid overwriting that stuff on the trusted side, when possible.
Additionally, it should be noted that bisync's current approximation of
--ignore-existingdoes have a performance benefit, because in 1 of the 2 directions it can skip the modtime (or checksum) check for some of the files. (But that performance benefit is negated if using--create-empty-src-dirs, which requires a third operation -- unless we change that.)I tend to think that rclone's default (which is still slightly asymmetrical) should be bisync's default:
but that this should be overridable with flags for users who think this is madness 😄
@ncw I think this is ultimately a question for you -- what is your guiding principle for breaking changes such as this, where it's not exactly a bug, but there does seem to be consensus that a different way would be better? Is it ok to change the behavior, provided it's documented clearly? (And is the calculation different because bisync is still in beta?)
31 remaining items
bisync: optimize --resync performance -- partially addresses rclone#5681
bisync: add --resync-mode for customizing --resync - fixes rclone#5681
bisync: optimize --resync performance -- partially addresses #5681
bisync: add --resync-mode for customizing --resync - fixes rclone#5681
bisync: add --resync-mode for customizing --resync - fixes #5681
Merge branch 'master' into ia-wt-1168
bisync: optimize --resync performance -- partially addresses rclone#5681
bisync: add --resync-mode for customizing --resync - fixes rclone#5681