Re: [nfsv4] NFSv4 Referral handling by client

Trond Myklebust <trondmy@gmail.com> Sat, 15 November 2014 18:13 UTC

Return-Path: <trondmy@gmail.com>
X-Original-To: nfsv4@ietfa.amsl.com
Delivered-To: nfsv4@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 4C6C71ACE0B for <nfsv4@ietfa.amsl.com>; Sat, 15 Nov 2014 10:13:37 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, SPF_PASS=-0.001] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0KoBnMLur7ta for <nfsv4@ietfa.amsl.com>; Sat, 15 Nov 2014 10:13:34 -0800 (PST)
Received: from mail-ig0-x22f.google.com (mail-ig0-x22f.google.com [IPv6:2607:f8b0:4001:c05::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D02C21ACE08 for <nfsv4@ietf.org>; Sat, 15 Nov 2014 10:13:33 -0800 (PST)
Received: by mail-ig0-f175.google.com with SMTP id h15so1362196igd.14 for <nfsv4@ietf.org>; Sat, 15 Nov 2014 10:13:33 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=HD5J9Sym4/b29yp0VhMi+cgbGJAh8pQ/gLXM3ciHAiE=; b=bNiaatsxRKwpjqqxtWx/EAO+YQpRn2NaCsPJrEO2H5cU4KzPsIYajFJOor0ddBg1km LJtZarWWT5HjMNSTZUhzoWS7cWQqnrkMeAjbhakEbvMvqUxy0ZEBSXcUv23VSdXVrERr iS029oWnb51xyMktCGXTUCsfRvAOiwqzrqWJedW1Ge0UfN93VKLRaxzybTUFNw8liDAC aQa13PXYafT3hquWU5eOxkKCYh1I4yZ+j008cr0TB/Sw97xtl+AYBSeJdARmKZQssyBR UO9KO66yfOgGp2U9kwSjD/oHO7FCZHcY5bXAteQxwSUDluDm4R4k9DtdaGUo8XaEphYx QSiA==
MIME-Version: 1.0
X-Received: by 10.107.7.91 with SMTP id 88mr2950169ioh.70.1416075213069; Sat, 15 Nov 2014 10:13:33 -0800 (PST)
Received: by 10.107.135.29 with HTTP; Sat, 15 Nov 2014 10:13:33 -0800 (PST)
In-Reply-To: <CAHVwH2FhT_HrFDRL3sTcCdori3o6=-adigQ057yB6XTLDA8Xwg@mail.gmail.com>
References: <CAHVwH2G=L_V_hZ1mY+qP68bhMGLy=v3wLG4V4Ny4NNZBFgn69w@mail.gmail.com> <CAABAsM4=m-sDgQbXyEcu5cpLT+rWnRg=gPdGDXRtCAJr-dR+ig@mail.gmail.com> <CAHVwH2FhT_HrFDRL3sTcCdori3o6=-adigQ057yB6XTLDA8Xwg@mail.gmail.com>
Date: Sat, 15 Nov 2014 13:13:33 -0500
Message-ID: <CAABAsM5Ce-7SMqW8FVmzkcVvWh-KALTAhJqfV4FWD_cYwHkUAg@mail.gmail.com>
From: Trond Myklebust <trondmy@gmail.com>
To: Rahul Shah <shahrahulb@gmail.com>
Content-Type: text/plain; charset="UTF-8"
Archived-At: http://mailarchive.ietf.org/arch/msg/nfsv4/tU5c5BJ_WP73BNXpheYeS7WHCaA
Cc: "nfsv4@ietf.org" <nfsv4@ietf.org>
Subject: Re: [nfsv4] NFSv4 Referral handling by client
X-BeenThere: nfsv4@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: NFSv4 Working Group <nfsv4.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/nfsv4>, <mailto:nfsv4-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/nfsv4/>
List-Post: <mailto:nfsv4@ietf.org>
List-Help: <mailto:nfsv4-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/nfsv4>, <mailto:nfsv4-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 15 Nov 2014 18:13:37 -0000

On Fri, Nov 14, 2014 at 9:40 PM, Rahul Shah <shahrahulb@gmail.com> wrote:
> Hi Trond,
>
> Thanks for your reply. I understand the behavior of 8.3.2 with respect to
> READDIR.
> However If you look closely in my case TEST_2, Client has performed READDIR
> in "step 3" while the filehandle was still PRESENT at the server. Once
> server returns the present filehandle to client, then after few seconds I am
> setting a referral on the directory "c" at server side.
> So basically client has stale filehandle. In step 6 when the client does "cd
> c", it is sending
> PUTFH (of "c" it got fh from previous READDIR), ACCESS (of "c"), GETATTR
> (without fs_locations)
>
> Even though I return NFS4ERR_MOVED for ACCESS, client never attempted to
> send new GETFH or GETATTR (with fs_locations) to the server.
>
> If you want, I can send you the pcap for both the above cases.

The IETF NFSv4 mailing list is not the correct venue for filing bug reports.

However, in clarification: a referral is an object that does not ever
have a filehandle, but is just a placeholder for a missing filesystem.
What you are describing above is considered to be a migration event.
You've handed out a filehandle for an object, and are now saying that
the object pointed to by that filehandle has been migrated to a
different server. Most clients today do not yet have full support for
the NFSv4 migration protocol since dealing with objects that move adds
whole new levels of complexity to state management and recovery.

Cheers
  Trond


> On Fri, Nov 14, 2014 at 8:26 PM, Trond Myklebust <trondmy@gmail.com> wrote:
>>
>> On Fri, Nov 14, 2014 at 7:14 PM, Rahul Shah <shahrahulb@gmail.com> wrote:
>> > I am working NFSv4 referral implementation on the server side and
>> > noticed
>> > one of the occasion client never requested GETATTR with fs_locations
>> > even
>> > though server returns NFS4ERR_MOVED.
>> >
>> > I am running two set of test.
>> >
>> > TEST_1: works as expected and client is redirected to remote server.
>> >
>> > 1) Client mounts to server_a
>> > 2) cd /a/b
>> > 3) From the server set referrals on directory /a/b/c and point it to
>> > some
>> > remote server
>> > 4) cd "c"
>> > 5) What I observed is, client sends PUTFH (of "b"), LOOKUP (of "c"),
>> > GETFH,
>> > GETATTR
>> > 6) Server returns NFS4ERR_MOVED for GETFH
>> > 7) Clients sends PUTFH (of "b"), LOOKUP (of "c"), GETATTR (requesting
>> > fs_locations)
>> > 8) Server returns all referral information and client happily connects
>> > to
>> > server_b
>> >
>> > TEST_2 : Client never requests fs_locations
>> >
>> > 1) Client mounts to some path on server_a
>> > 2) cd /a/b
>> > 3) READDIR "ls" on /a/b which returns filehandle of "c"
>> > 4) From the server set referrals on directory /a/b/c and point it to
>> > some
>> > remote server
>> > 5) cd to "c"
>> > 5) While catching the tcpdumps, I observed client sending requests
>> >     PUTFH (of "c" it got fh from previous READDIR), ACCESS (of "c"),
>> > GETATTR
>> > (without fs_locations)
>> > As per RFC 3530, NFS4ERR_MOVED is a valid return code from ACCESS.
>> >
>> > From the server I tried returning NFS4ERR_MOVED for ACCESS. Client just
>> > gives up  and NEVER sends  PUTFH (of "c"), LOOKUP (of "c"), GETATTR
>> > (requesting fs_locations)
>> > I also tried returning NFS4ERR_MOVED for PUTFH. Client again gives up
>> > and
>> > NEVER sends  PUTFH (of "c"), LOOKUP (of "c"), GETATTR (requesting
>> > fs_locations)
>> >
>>
>> A full description of how NFSv4 referrals are expected to work can be
>> found in the section on "absent filesystems" in the latest draft of
>> RFC3530bis:
>>     http://tools.ietf.org/html/draft-ietf-nfsv4-rfc3530bis-34#section-8.2
>>
>> If you read through that, you will see that the most likely cause of
>> the client's confusion is that your server returned a filehandle in
>> the READDIR operation. Most existing clients expect that a server that
>> has an absent filesystem will instead implement the behaviour
>> described in
>>
>> http://tools.ietf.org/html/draft-ietf-nfsv4-rfc3530bis-34#section-8.3.2
>>
>> Cheers
>>   Trond
>
>