gluster-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gluster-devel] [PATCH BUG:3085] Make backupvolfile-server option actual


From: Jeff Darcy
Subject: [Gluster-devel] [PATCH BUG:3085] Make backupvolfile-server option actually work.
Date: Fri, 24 Jun 2011 13:26:57 -0400
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b3pre Thunderbird/3.1.10

>From b5e1a48a067ac1f72b7655f5f13bf46d9bde8334 Mon Sep 17 00:00:00 2001

The problem was that glusterfs would return zero (success) as soon as it
forked, before we really knew whether the mount using the primary
volfile server had actually succeeded or failed.  This code actually
checks for the appearance of the volume in our mount table, and retries
using the backup volfile server if it doesn't show up in a reasonable
amount of time.

It's hacky, and I know something better is coming along, but this issue
comes up daily in the IRC channel and not everyone wants to set up RRNDS
for something that a script should be able to handle.  Whoever added the
backupvolfile-server option probably meant for it to help in these
cases, but it wasn't working.

Signed-off-by: Jeff Darcy <address@hidden>
---
 xlators/mount/fuse/utils/mount.glusterfs.in |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/xlators/mount/fuse/utils/mount.glusterfs.in
b/xlators/mount/fuse/utils/mount.glusterfs.in
index e429eca..aca43a9 100755
--- a/xlators/mount/fuse/utils/mount.glusterfs.in
+++ b/xlators/mount/fuse/utils/mount.glusterfs.in
@@ -123,13 +123,25 @@ start_glusterfs ()
     err=0;
     $cmd_line;

+    found=0
+    for i in $(seq 0 10); do
+       sleep 3
+       mount | cut -d" " -f3 | grep "^$mount_point$"
+       if [ $? = 0 ]; then
+           echo "There it is!"
+           found=1
+           break
+        fi
+       echo "Still not there..."
+    done
+
     # retry the failover
-    if [ $? != "0" ]; then
-        err=1;
+    if [ $found = 0 ]; then
+       echo "Trying backupvolfile_server"
         if [ -n "$cmd_line1" ]; then
             cmd_line1=$(echo "$cmd_line1 $mount_point");
             $cmd_line1
-            if [ $? != "0"]; then
+            if [ $? != "0" ]; then
                 err=1;
             fi
         fi
-- 
1.7.3.4



reply via email to

[Prev in Thread] Current Thread [Next in Thread]