Return-Path: linux-nfs-owner@vger.kernel.org Received: from mx2.netapp.com ([216.240.18.37]:50232 "EHLO mx2.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759438Ab2FAV5g (ORCPT ); Fri, 1 Jun 2012 17:57:36 -0400 Received: from vmwexceht02-prd.hq.netapp.com (vmwexceht02-prd.hq.netapp.com [10.106.76.240]) by smtp1.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id q51LvaPD022201 for ; Fri, 1 Jun 2012 14:57:36 -0700 (PDT) From: "Adamson, Dros" To: "Adamson, Andy" CC: "Isaman, Fred" , "" Subject: Re: [PATCH 3/6] PYNFS use loopback addresses for MDS<->DS communication Date: Fri, 1 Jun 2012 21:57:35 +0000 Message-ID: References: <1338328679-28837-1-git-send-email-andros@netapp.com> <1338328679-28837-4-git-send-email-andros@netapp.com> In-Reply-To: <1338328679-28837-4-git-send-email-andros@netapp.com> Content-Type: multipart/signed; boundary="Apple-Mail=_F698419F-C50E-4C9D-92C4-1C8D4473E1E8"; protocol="application/pkcs7-signature"; micalg=sha1 MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org List-ID: --Apple-Mail=_F698419F-C50E-4C9D-92C4-1C8D4473E1E8 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii I think I gave this to Fred some time ago. This patch is a hack that = only works when the MDS and all data servers are run on the same host. It's easy enough to use aliases on an interface and bring those down, = but the ordering problem remains:=20 The pynfs MDS <-> DS backchannel uses the first address in the address = list and most clients (including linux) will use the first address that = works when communicating with data servers, so bringing down the alias = that the DS is communicating on will also break the pynfs backchannel. I'll rework the patch to allow this testing on both localhost and across = hosts. -dros =20 On May 29, 2012, at 5:57 PM, wrote: > From: Weston Andros Adamson >=20 > if a loopback addresses is specified for a DS, use that address for = MDS to DS > communication and remove it from the advertised addresses in = getdeviceinfo > (it obviously would never work). >=20 > this is useful for testing network partitions - you can bring down / = firewall > off an interface without breaking MDS<->DS communications. >=20 > an example dataservers.conf: >=20 > 192.168.55.1:12345,127.0.0.1:12345/pynfs_mds > 192.168.55.1:12346,127.0.0.1:12346/pynfs_mds >=20 > Signed-off-by: Weston Andros Adamson > --- > nfs4.1/dataserver.py | 28 ++++++++++++++++++++++------ > 1 files changed, 22 insertions(+), 6 deletions(-) >=20 > diff --git a/nfs4.1/dataserver.py b/nfs4.1/dataserver.py > index 65e4f55..dd2a535 100644 > --- a/nfs4.1/dataserver.py > +++ b/nfs4.1/dataserver.py > @@ -187,9 +187,27 @@ class DSDevice(object): > log.critical("Could not parse line: %r" % line) > sys.exit(1) >=20 > - # for now, just use the last path for local = connections > - server, port =3D server_list[-1] > - server_list =3D server_list[:-1] > + # if there is a (IPv4) loopback address in the = multipath list, > + # use that as the connection to the DS, but dont = advertise it > + loopback_idx =3D -1 > + for i, serverport in enumerate(server_list): > + if serverport[0] =3D=3D '127.0.0.1': > + loopback_idx =3D i > + break > + > + if loopback_idx >=3D 0: > + print "Using loopback address for MDS->DS = communication only" > + server_list =3D list(server_list) > + server, port =3D server_list.pop(loopback_idx) > + else: > + # just use the last path for local connections > + server, port =3D server_list[-1] > + > + if not server_list: > + log.critical("At least one non-loopback address = must " + > + "be specified for each DS") > + sys.exit(1) > + > print server, port, path > try: > log.info("Adding dataserver ip:%s port:%s path:%s" = % > @@ -210,9 +228,7 @@ class DSDevice(object): > index =3D 0 > for d in self.list: > if d.active: > - multipath =3D [] > - multipath.extend(d.get_multipath_netaddr4s()) > - multipath.append(d.get_netaddr4()) > + multipath =3D d.get_multipath_netaddr4s() > netaddrs.append(multipath) > stripe_indices.append(index) > index =3D index + 1 > --=20 > 1.7.7.6 >=20 --Apple-Mail=_F698419F-C50E-4C9D-92C4-1C8D4473E1E8 Content-Disposition: attachment; filename="smime.p7s" Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoI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