Closed (works as designed)
Project:
Provision
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
21 Feb 2011 at 12:48 UTC
Updated:
24 Jan 2012 at 22:18 UTC
Jump to comment: Most recent
Comments
Comment #1
Anonymous (not verified) commentedrsync only syncs the stuff that is different, it doesn't sync 'all platform files'.
--update just ignores files on the destination that are newer, doesn't it?
And you could cause problems with this by updating a module on the remote platform (maybe drop a column in the db or something), do a migrate, and if the new target platform doesn't have those code changes, it could cause php exceptions. The point is to not be able to ignore new changes on the remote side, but replace them with the pristine aegir hostmaster copy (spoke model).
Maybe it wouldn't be a big problem though, I'm probably wrong or misunderstanding something. Maybe expand on what you're seeing as the platform having 'all its files' synced? Which sounds like it's not obeying the rules of rsync in drush.
Comment #2
eugenmayer commentedwell just test:
without --upadte, you _always_ transfer all files, no matter what. Use --stats. So --update really makes a huge difference.
It is a 2 way ticket. If the source has a newer file then dest, only that file is transfered
The issue you mentioned could actually happen, thats true. But it could even be a feature, not overriding source changed on the dest. For my taste, there is a golden rule for aegir platforms:
- Dont touch them by hand!
- Never change a platform - rather create a new one and migrate
If you think --update is not the best for the broad users ( i expect it thiouh ), we could simply take it in as a configuration? Having an array which later gets merged there. So people could activate compress or other stuff (if needed).
What do you think?
Comment #3
memtkmcc commentedThat is true - rsync will transfer all files again on every run if you don't use
-uoption. See example: https://gist.github.com/838524Comment #4
anarcat commentedI think I disagree with your stated assumption:
The manual says otherwise:
I have been using rsync for a long time, and rsync doesn't sync everything just because -u isn't there. A clear example:
Notice how the first run sync'd all the data, while the second didn't. So -u is not the answer here. -c could have the same result, as it uses checksums to compare files, but -t is usually enough and less CPU-intensive.
To quote the manual again:
Comment #5
memtkmcc commented@anarcat - rysnc does copies *all* files every time your run it without -u [edit: or -t], please see this simple example: https://gist.github.com/838524
Comment #6
memtkmcc commentedHowever, if you will use -t (without -u) with first rsync, the next rsync will of course transfer only changed file and the next attempt to rsync even without -t option will still copy only changed files.
Example: https://gist.github.com/842122
But if you will rsync without -t or -u option every time, it will transfer *all* files again on every attempt, even if only one file has changed in the source directory.
Example: https://gist.github.com/842121
Comment #7
memtkmcc commentedHmm.. now I'm not sure - does the -t by adding times is more reliable than -u option in this case? What if the local and remote servers have different system time (or even date)? Will this break anything?
Comment #8
anarcat commented@octopus - I read the example you mention (https://gist.github.com/838524) before replying - did you read the documentation about -u? I do not think it is what you think it is:
Why a file on the remote server would have a modified time **newer** than the source is beyond me, and -u doesn't *update* the timestamps, so you are bound to reupdate the files anyways, or to update the wrong files. It also operates only on the receiver end and *skips* files. For example, if the remote file has been "touched" while the local file needs to be synced up, -u will forbid that to happen, which I don't think is what we want.
I agree that not using -t, -u (or -c) is sub-optimal - but it works right now, where as using -u would actually introduce a bug (ignoring some remote files). -t is the usual way this is done (ie. it's in -a).
If times are not sync'd you're screwed anyways, whether you use -t or -u because well, they rely on times. :) Although it will affect -u more, because -t sets the time as seen from the source server, while -u relies on the target's notion of time.
To put this shortly: I recognize we can optimise this. -u is not the right way, -c or -t is.
Comment #9
memtkmcc commented@anarcat - I was confused a bit since I never used rsync without options, always with some mix or just -a, but you are right - the -u option would introduce a new layer of chaos/bugs in the already enough hard to understand magic introduced by this remote stuff in Aegir. Thanks for clarify it!
Comment #10
steven jones commentedSo, at the moment we just play this safe, and we get rsync to check the contents of every file. This does NOT mean we actually transfer each file though.
Marking as postponed until someone wants to pick this up and come up with a good solution/benchmarks.
Comment #11
orever commentedRsync does NOT "always transfer files" without -u. Straight from the man page, rsync uses a "quick check" algorithm to determine what files have updated by looking only at the file size and timestamp. If either of those are different for a file, then it does a full comparison using the delta change algorithm. The delta change algorithm compares files on the source and destination by performing a checksum on each file chunk, and does not transfer the entire file while doing this comparison.
When you run it from the command line you will see it print out every file name, but that does not mean it is actually transferring the file data. The only data that gets transferred are the information required to compare the files, such as the file list, timestamp, size, etc..., and the data chunks for any file that has changed or new files. The bandwidth usage that is reported includes any speedup gained by having partial files on the destination side, so it may appear to be doing something that it's not.
This ticket should be closed.
Comment #12
anarcat commentedThe point here is that we should use -t to make sure the remote timestamps are updated when we sync, which optimizes the transfer. Again quoting the manual:
But I agree we could just close this ticket already, as even if -t is not used, rsync will only transfer what is needed. That can be easily seen with --progress, on big files... So, closing.