[Gluster-devel] [PATCH BUG:3085] Make backupvolfile-server option actually work.

Devon Miller devon.c.miller at gmail.com
Mon Jun 27 12:09:41 UTC 2011


Mind you I haven't looked at this patch in context of the
xlators/mount/fuse/utils/mount.glusterfs.in 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?

dcm

On Fri, Jun 24, 2011 at 1:26 PM, Jeff Darcy <jdarcy at redhat.com> wrote:

> 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 <jdarcy at redhat.com>
> ---
>  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
>
> _______________________________________________
> Gluster-devel mailing list
> Gluster-devel at nongnu.org
> https://lists.nongnu.org/mailman/listinfo/gluster-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://supercolony.gluster.org/pipermail/gluster-devel/attachments/20110627/bff1178d/attachment-0003.html>


More information about the Gluster-devel mailing list