support volfile fetch from multiple glusterd nodes
authorRaghavendra Talur <rtalur@redhat.com>
Thu, 25 Aug 2016 10:33:55 +0000 (16:03 +0530)
committerGünther Deschner <gd@samba.org>
Fri, 14 Oct 2016 15:09:24 +0000 (17:09 +0200)
commit857745655bd29656de3b0f96765d6b65221f3a3e
tree8fb06f09158b9f94f116753ba2c993f0894eeddd
parent1d2d0c34fc6e7d217f322adb6b6d3e920cbedf89
support volfile fetch from multiple glusterd nodes

glusterfs:volfile_server option can be used in smb.conf to define where
to fetch the volfile from. Currently it supports only a single IP or a
hostname. The default is 'localhost'.

glfs_set_volfile_server() has been enhanced in gfapi to support
multiple invocations. A list is maintained in libgfapi which gets
appended on every invocation. When glfs_init is performed, libgfapi
would first try to fetch the volfile from glusterd on that node.
However, on failure to fetch the volfile, it would proceed to contact
glusterd on every node in the list until it gets the volfile or
exhausts the list. This enhacement was done in Gluster commit [2].
This commit is available in 3.6, 3.7, 3.8 versions of Gluster.

As we cannot have multiple lines having the same key of
glusterfs:volfile_server in a share definition in smb.conf, we propose
a scheme like this:

where value of glusterfs:volfile_server could be list of white space seperated
elements where each element could be unix+/path/to/socket/file or
[tcp+]IP|hostname|\[IPv6\][:port].

Note the restriction on naming a IPv6 host, it follows the same
restriction that is based on IPv6 naming in URL as per RFC 2732[1].

[1] http://www.ietf.org/rfc/rfc2732.txt
[2] 0c1d78f5c52c69268ec3a1d8d5fcb1a1bf15f243

Signed-off-by: Raghavendra Talur <rtalur@redhat.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Fri Oct 14 17:09:24 CEST 2016 on sn-devel-144
docs-xml/manpages/vfs_glusterfs.8.xml
source3/modules/vfs_glusterfs.c