junneyang / zumastor

Automatically exported from code.google.com/p/zumastor
0 stars 1 forks source link

Upgrading zumastor packages leaves zumastor non-functional #119

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Install old packages
2. Zumastor define volume .....
3. mkfs
4. zumastor define master
5. zumastor define schedule
6. date > /var/run/zumastor/mount/.../datefile
7. zumastor snapshot
8. (repeat 6 and 7 a few times)
9. Upgrade zumastor/ddsnap packages
10. zumastor snapshot

What is the expected output? What do you see instead?
Expect a snapshot to be taken.
Instead, `zumastor snapshot` hangs until killed. Note that the zumastor 
master process is not running.

Please use labels and text to provide additional information.
First noted by pgquiles on irc. Tested on hardware test environment to 
diagnose.

Original issue reported on code.google.com by williama...@gmail.com on 21 Apr 2008 at 11:15

GoogleCodeExporter commented 9 years ago
Note: You can work around this issue by stopping/starting zumastor by hand 
after 
the upgrade is complete.
eg:
apt-get dist-upgrade
.....
/etc/init.d/zumastor stop
sleep 1
/etc/init.d/zumastor start

Original comment by williama...@gmail.com on 21 Apr 2008 at 11:31

GoogleCodeExporter commented 9 years ago
Trialing fix in r1570

Original comment by williama...@gmail.com on 22 Apr 2008 at 12:25

GoogleCodeExporter commented 9 years ago
The problem is zumastor master is not running after the upgrade completes. 
Changes 
committed in r1570 did not fix the problem.

Original comment by williama...@gmail.com on 22 Apr 2008 at 1:13

GoogleCodeExporter commented 9 years ago
Turns out this issue does not occur if packages are installed by hand with dpkg 
instead of using apt and friends.

Original comment by williama...@gmail.com on 22 Apr 2008 at 1:58

GoogleCodeExporter commented 9 years ago
Attaching strace of lines ~383-389 in /bin/zumastor (as of r1575).
Looks like we fail after 
'''
read kind <$fifo || { log "error when reading pipe $?" $log; sleep 1; continue; 
}
'''
Though I could be reading this wrong.

Original comment by williama...@gmail.com on 22 Apr 2008 at 7:03

Attachments:

GoogleCodeExporter commented 9 years ago
If you want to setup a tiny apt repository to test things:

#!/bin/sh -x
mkdir /tmp/repo
cd /tmp/repo
wget http://host/zumastor_0.8.0-r1575_all.deb
dpkg-scanpackages . /dev/null > Packages
gzip -c Packages > Packages.gz
echo "deb file:/tmp/repo /" >> /etc/apt/sources.list
apt-get -q -y --force-yes update
echo "Done."

(then you can `apt-get -q -y --force-yes install zumastor`)

Original comment by williama...@gmail.com on 22 Apr 2008 at 7:08

GoogleCodeExporter commented 9 years ago
Adding `lsof` and `env` from within the apt postinst script. 

Original comment by williama...@gmail.com on 22 Apr 2008 at 11:03

Attachments:

GoogleCodeExporter commented 9 years ago
Looks like the problem is caused by a SIGHUP signal sent to 'zumastor master'. 
I am
not sure it is apt-get that sends that signal. As a quick fix, I think we can 
just
trap that signal in run_master. Here is the proposed fix.

Index: bin/zumastor
===================================================================
--- bin/zumastor        (revision 1580)
+++ bin/zumastor        (working copy)
@@ -375,6 +375,7 @@ function run_master {
                fi
        fi

+       trap '' HUP
        # we reopen the log for each write so rotation works
        pid=""
        while true; do

Jiaying

Original comment by jiayin...@gmail.com on 24 Apr 2008 at 2:46

GoogleCodeExporter commented 9 years ago
LGTM

Original comment by williama...@gmail.com on 24 Apr 2008 at 3:57

GoogleCodeExporter commented 9 years ago
Looks good to me, as long as you add a comment explaining why it's there.

Original comment by daniel.r...@gmail.com on 25 Apr 2008 at 5:36

GoogleCodeExporter commented 9 years ago

Original comment by williama...@gmail.com on 25 Apr 2008 at 7:48