lipengyu / lsyncd

Automatically exported from code.google.com/p/lsyncd
GNU General Public License v2.0
0 stars 0 forks source link

No re-sync to nodes other than first one #58

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Setup lsyncd to sync to 2+ different nodes (lsyncd -rsyncssh /test/ node1 
/test/ -rsyncssh /test/ node2 /test/)
2. Set sshd down on 'node2'.
3. Make some changes on files from /test.

What is the expected output? What do you see instead?
'node2' would be synced when sshd come up again, but instead it doesn't.

What version of the product are you using? On what operating system?
Linux CentOS 5.5 x64
lsyncd 2.0.4

Please provide any additional information below.
If you set sshd down on 'node1' and take the same steps, 'node1' is being 
synced when sshd come up again

Original issue reported on code.google.com by danlsg...@gmail.com on 10 May 2011 at 1:23

GoogleCodeExporter commented 9 years ago
Did some tests now and noticed that lsyncd try to replicate to node2 (which was 
down and become up)... but inotify doesn't trigger any action when we (create, 
truncate) a file using >filename... only using touch.

Original comment by danlsg...@gmail.com on 10 May 2011 at 3:32

GoogleCodeExporter commented 9 years ago
Looks like rsyncssh is triggering DELETE actions at last... So, if I do rm -f * 
followed by touch file, it will replicate first the touch file and after rm -f 
*, in an inconsistent replication.

Original comment by danlsg...@gmail.com on 10 May 2011 at 3:42

GoogleCodeExporter commented 9 years ago
Actually Lsyncd 2.0.x does collapse multiple actions on one file in a logical 
way. So a DELETE followed by a CREATE should collapse into a CREATE only, since 
that one will override the old file anyway. If there is a logical fault in 
collapsing event, please try to reproduce a minimal example and post a log with 
either "-log all" or "-log Delay" at least.

Original comment by axk...@gmail.com on 10 May 2011 at 5:39

GoogleCodeExporter commented 9 years ago
Yes, but if I make a "rm -rf *" in a dir, this will be the last action applyed 
doesn't matter if I created, moved or updated any files before.

1. create a list of files if "for i in `seq 1 100`; do touch $i; done"
2. stop sshd on the node.
3. rm -rf * on all dir files.
4. touch newfile.txt
5. echo "yes" > newfile.txt
6. start sshd on the node

After these steps node will be empty, even if I created and updated some files 
after rm -rf *.

Original comment by danlsg...@gmail.com on 12 May 2011 at 11:54

GoogleCodeExporter commented 9 years ago
First let me ask for apology that it took me 4 months to be able to finally 
allocate an hour for this. I tested it exactly as you descried and it works for 
me with Lsyncd 2.0.4 as well as the current SVN version. If you wish please 
email me a logfile creaeted with '-log all' ideally with comments on which 
moment you did what.

Kind regards, Axel

Original comment by axk...@gmail.com on 18 Aug 2011 at 1:53