mpalmer / lvmsync

Synchronise LVM LVs across a network by sending only snapshotted changes
http://theshed.hezmatt.org/lvmsync
GNU General Public License v3.0
380 stars 60 forks source link

lvmsync hangs and i must exit with ctrl+c #37

Closed WMP closed 9 years ago

WMP commented 9 years ago
root@gaja ~/lvmsync # ./lvmsync_diff.sh 
  Logical volume "test-snapshot" created
creating file normal_test.20141012-0931
creating file snapshot_test.20141012-0931
lvmsync...
Origin device: /dev/mapper/virtual-test
Sending chunk 0..4095...
Seeking to 0 in /dev/mapper/virtual-test
Remote prematurely closed the connection
remote:bash: /usr/local/bin/lvmsync: Permission denied
^C/usr/local/rvm/gems/ruby-2.1.1/gems/lvmsync-3.1.3/bin/lvmsync:208:in `select': Interrupt
        from /usr/local/rvm/gems/ruby-2.1.1/gems/lvmsync-3.1.3/bin/lvmsync:208:in `block (2 levels) in run_client'
        from /usr/local/rvm/gems/ruby-2.1.1/gems/lvmsync-3.1.3/bin/lvmsync:258:in `rescue in block (2 levels) in dump_changes'
        from /usr/local/rvm/gems/ruby-2.1.1/gems/lvmsync-3.1.3/bin/lvmsync:253:in `block (2 levels) in dump_changes'
        from /usr/local/rvm/gems/ruby-2.1.1/gems/lvmsync-3.1.3/bin/lvmsync:243:in `each'
        from /usr/local/rvm/gems/ruby-2.1.1/gems/lvmsync-3.1.3/bin/lvmsync:243:in `block in dump_changes'
        from /usr/local/rvm/gems/ruby-2.1.1/gems/lvmsync-3.1.3/bin/lvmsync:242:in `open'
        from /usr/local/rvm/gems/ruby-2.1.1/gems/lvmsync-3.1.3/bin/lvmsync:242:in `dump_changes'
        from /usr/local/rvm/gems/ruby-2.1.1/gems/lvmsync-3.1.3/bin/lvmsync:204:in `block in run_client'
        from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/open3.rb:199:in `popen_run'
        from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/open3.rb:93:in `popen3'
        from /usr/local/rvm/gems/ruby-2.1.1/gems/lvmsync-3.1.3/bin/lvmsync:203:in `run_client'
        from /usr/local/rvm/gems/ruby-2.1.1/gems/lvmsync-3.1.3/bin/lvmsync:106:in `main'
        from /usr/local/rvm/gems/ruby-2.1.1/gems/lvmsync-3.1.3/bin/lvmsync:300:in `<top (required)>'
        from /usr/local/rvm/gems/ruby-2.1.1/bin/lvmsync:23:in `load'
        from /usr/local/rvm/gems/ruby-2.1.1/bin/lvmsync:23:in `<main>'
        from /usr/local/rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
        from /usr/local/rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'

root@gaja ~/lvmsync #

Lvmsync hangs over remote:bash: /usr/local/bin/lvmsync: Permission denied

mpalmer commented 9 years ago

Out of curiosity, are you using SSH ControlMaster (or "multiplexed connections")? If so, you're getting bitten by what I believe is a bug in OpenSSH (the mux channel holds open stderr) but the OpenSSH authors disagree. I've hit this problem before, and I'll introduce changes to lvmsync to work around the problem.

mpalmer commented 9 years ago

I've just released 3.2.0, which contains some changes around the remote output reading code, and a workaround for OpenSSH's pathological behaviour. I'd appreciate it if you could try it out, and let me know if it fixes your problems. If it doesn't, it would help me understand what's happening if you could give me the lsof output of the lvmsync process (lsof -n -p <PID>).

WMP commented 9 years ago
  Logical volume "test-snapshot" created                                                                                                                                   
creating file normal_test.20141014-1201                                                                                                                                    
creating file snapshot_test.20141014-1201                                                                                                                                  
lvmsync...                                                                                                                                                                 
Data source: /dev/mapper/virtual-test                                                                                                                                      
Sending chunk 0..4095...                                                                                                                                                   
Seeking to 0 in /dev/mapper/virtual-test                                                                                                                                   
Sending chunk 8679424..8683519...                                                                                                                                          
Seeking to 8679424 in /dev/mapper/virtual-test
Sending chunk 92274688..92278783...
Seeking to 92274688 in /dev/mapper/virtual-test
Sending chunk 92278784..92282879...
Seeking to 92278784 in /dev/mapper/virtual-test
Sending chunk 92282880..92286975...
Seeking to 92282880 in /dev/mapper/virtual-test
Sending chunk 266240..270335...
Seeking to 266240 in /dev/mapper/virtual-test
Sending chunk 278528..282623...
Seeking to 278528 in /dev/mapper/virtual-test
Sending chunk 294912..299007...
Seeking to 294912 in /dev/mapper/virtual-test
Sending chunk 299008..303103...
Seeking to 299008 in /dev/mapper/virtual-test
remote:bash: /usr/local/bin/lvmsync: Permission denied
Sending chunk 4489216..4493311...
Seeking to 4489216 in /dev/mapper/virtual-test
Remote prematurely closed the connection
APPLY FAILED.
lvmsync done
cleanup
  Logical volume "test-snapshot" successfully removed

Works good, thanks ;)