Mind you I haven't looked at this patch in context of the <meta http-equiv="content-type" content="text/html; charset=utf-8">xlators/mount/fuse/utils/<a href="http://mount.glusterfs.in/" target="_blank">mount.glusterfs.in</a> file, I've just looked at the patch itself. However, it looks like *err* can only be set if *cmd_line1* is defined. What happens if cmd_line1 is empty?<div>
<br></div><div>dcm<br><br><div class="gmail_quote">On Fri, Jun 24, 2011 at 1:26 PM, Jeff Darcy <span dir="ltr"><<a href="mailto:jdarcy@redhat.com">jdarcy@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
>From b5e1a48a067ac1f72b7655f5f13bf46d9bde8334 Mon Sep 17 00:00:00 2001<br>
<br>
The problem was that glusterfs would return zero (success) as soon as it<br>
forked, before we really knew whether the mount using the primary<br>
volfile server had actually succeeded or failed. This code actually<br>
checks for the appearance of the volume in our mount table, and retries<br>
using the backup volfile server if it doesn't show up in a reasonable<br>
amount of time.<br>
<br>
It's hacky, and I know something better is coming along, but this issue<br>
comes up daily in the IRC channel and not everyone wants to set up RRNDS<br>
for something that a script should be able to handle. Whoever added the<br>
backupvolfile-server option probably meant for it to help in these<br>
cases, but it wasn't working.<br>
<br>
Signed-off-by: Jeff Darcy <<a href="mailto:jdarcy@redhat.com">jdarcy@redhat.com</a>><br>
---<br>
xlators/mount/fuse/utils/<a href="http://mount.glusterfs.in" target="_blank">mount.glusterfs.in</a> | 18 +++++++++++++++---<br>
1 files changed, 15 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/xlators/mount/fuse/utils/<a href="http://mount.glusterfs.in" target="_blank">mount.glusterfs.in</a><br>
b/xlators/mount/fuse/utils/<a href="http://mount.glusterfs.in" target="_blank">mount.glusterfs.in</a><br>
index e429eca..aca43a9 100755<br>
--- a/xlators/mount/fuse/utils/<a href="http://mount.glusterfs.in" target="_blank">mount.glusterfs.in</a><br>
+++ b/xlators/mount/fuse/utils/<a href="http://mount.glusterfs.in" target="_blank">mount.glusterfs.in</a><br>
@@ -123,13 +123,25 @@ start_glusterfs ()<br>
err=0;<br>
$cmd_line;<br>
<br>
+ found=0<br>
+ for i in $(seq 0 10); do<br>
+ sleep 3<br>
+ mount | cut -d" " -f3 | grep "^$mount_point$"<br>
+ if [ $? = 0 ]; then<br>
+ echo "There it is!"<br>
+ found=1<br>
+ break<br>
+ fi<br>
+ echo "Still not there..."<br>
+ done<br>
+<br>
# retry the failover<br>
- if [ $? != "0" ]; then<br>
- err=1;<br>
+ if [ $found = 0 ]; then<br>
+ echo "Trying backupvolfile_server"<br>
if [ -n "$cmd_line1" ]; then<br>
cmd_line1=$(echo "$cmd_line1 $mount_point");<br>
$cmd_line1<br>
- if [ $? != "0"]; then<br>
+ if [ $? != "0" ]; then<br>
err=1;<br>
fi<br>
fi<br>
<font color="#888888">--<br>
1.7.3.4<br>
<br>
_______________________________________________<br>
Gluster-devel mailing list<br>
<a href="mailto:Gluster-devel@nongnu.org">Gluster-devel@nongnu.org</a><br>
<a href="https://lists.nongnu.org/mailman/listinfo/gluster-devel" target="_blank">https://lists.nongnu.org/mailman/listinfo/gluster-devel</a><br>
</font></blockquote></div><br></div>