Re: [nfsv4] Server-side copy question

Olga Kornievskaia <aglo@citi.umich.edu> Mon, 23 October 2017 21:43 UTC

Return-Path: <olga.kornievskaia@gmail.com>
X-Original-To: nfsv4@ietfa.amsl.com
Delivered-To: nfsv4@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id DE30B13AB2B for <nfsv4@ietfa.amsl.com>; Mon, 23 Oct 2017 14:43:49 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.7
X-Spam-Level:
X-Spam-Status: No, score=-1.7 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.199, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=no autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
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 XAw2a6fvjFrl for <nfsv4@ietfa.amsl.com>; Mon, 23 Oct 2017 14:43:48 -0700 (PDT)
Received: from mail-ua0-x22b.google.com (mail-ua0-x22b.google.com [IPv6:2607:f8b0:400c:c08::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 323CE13A41A for <nfsv4@ietf.org>; Mon, 23 Oct 2017 14:43:44 -0700 (PDT)
Received: by mail-ua0-x22b.google.com with SMTP id i35so14010481uah.9 for <nfsv4@ietf.org>; Mon, 23 Oct 2017 14:43:44 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=Y1v/RbjWogb2EDbhVn7ZFTMWdY+/gDhimifoeyr33sg=; b=eAjTgCSKNRO96w/fwmUUK3GUT1E2Z4IJfC6iBZe+geoqRuCNEZRpds7/wJxM9kTjOp 23J0WvXLzieI1NtzQDrgAUGhy+C3CsfrJBrIx/VKPjhP239aqBj+a10Jg0T8cuR7WWEC 7Y/oxvJpSnQm4UwrQoDsh6PvLByqALUQej7ibSxLlTO/wenjKuQqsI9lU1s+fmu4Otat GOoxxW2J7BGSRj5DkLYRsAZ5EPfS3VOMc52FBg8y+QxwWS0PTbH89wLXhbIbMKHbJgYY CSZzvj0+arqwxWlf06PSttQz2mSqZqECc6n5LYoLdmEQ/iIE8J/b5Q5/iRon8Sqw7H/P 4MVQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=Y1v/RbjWogb2EDbhVn7ZFTMWdY+/gDhimifoeyr33sg=; b=iE1H3n+tMk04QesgV1ts0MVZs/1xn2hGNkBb5aAnnfJwQirdNjzXKGGehD541f4SMu cZ1FXe33AfEB9aF3hgKMAdO+b2xg3TWftds6VFseRmMCA14UXTIZ1ZtH0OEv/MAg4iJ6 7ZWihbOEGKrKQtcShQCb3OSyA4Vpy9LzpeiBwkcl26H8X+bwckiZ1gnsonWnoTG+twT5 aiy9UWfnY1/1+yJqQ7gfGzQRgFrD54Lf+JxoSvKXr8jQflDCtUgMqCFmjRoqNamxaqtx a5Gwhxf8Qyd4sQwZU/W6kZma+LQFdfL0BBWntKk7XR5EFgWQtGUfJrVkj99W9J3XWM7P RAPA==
X-Gm-Message-State: AMCzsaWs90F2p04WdHAvsAFP7OcJFTvQ0DnDm9kxWfNiPNDRC/geAoBz FBBJA0y0ViNH1Ljq1xJH9B+LFlhiqjVurJ4EQ80=
X-Google-Smtp-Source: ABhQp+RaPRfhq3i+k/foBzV/sGzH4oopLK/A0HfFoGzdpB34nZeNsy3tcXS4SyeyS6MfNKTMsqGxdWaIuGoV2aWk38c=
X-Received: by 10.159.55.239 with SMTP id q102mr11832028uaq.143.1508795023217; Mon, 23 Oct 2017 14:43:43 -0700 (PDT)
MIME-Version: 1.0
Sender: olga.kornievskaia@gmail.com
Received: by 10.103.59.202 with HTTP; Mon, 23 Oct 2017 14:43:42 -0700 (PDT)
In-Reply-To: <20171020193306.GF15211@fieldses.org>
References: <CADaq8jf5S55eBmuu7v+CAVFd+yZeSsU+aKwyL1F5rtr_xvnkMA@mail.gmail.com> <20170223150306.GA11882@fieldses.org> <CADaq8jc6vWdXonTs3795QWO8SWJTudo=x9=gR4uKN+tnfBk+dw@mail.gmail.com> <20170224222135.GJ26378@fieldses.org> <CAN-5tyHJb=ercWh_W2uzPfKR86j=dGWx=zYH1y+TjbNTzYh38A@mail.gmail.com> <20170228164420.GA28845@fieldses.org> <CADaq8jdivTUVNx2LXCiecAKY-nfoZP_XoAoNLwc3V1TUD6X8vg@mail.gmail.com> <CC84C4DB-F00F-45FC-8307-BDA5424DA480@netapp.com> <20170228173215.GA29700@fieldses.org> <CAN-5tyF8EZjYNX3cE43BPM9CbxVLygRdPuTJf_RgC7ntDCf9Kg@mail.gmail.com> <20171020193306.GF15211@fieldses.org>
From: Olga Kornievskaia <aglo@citi.umich.edu>
Date: Mon, 23 Oct 2017 17:43:42 -0400
X-Google-Sender-Auth: ACqNZ8O4XZrJwhp7FzH6JNlL-Tc
Message-ID: <CAN-5tyHaJeis=_f9h9u1St76Og3A_TtBUxZx_Z=ZouG7sa2=6w@mail.gmail.com>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: "Adamson, Andy" <William.Adamson@netapp.com>, "nfsv4@ietf.org" <nfsv4@ietf.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/nfsv4/yPaHYFj3bkK0JcA94wtq6wIY9Gw>
Subject: Re: [nfsv4] Server-side copy question
X-BeenThere: nfsv4@ietf.org
X-Mailman-Version: 2.1.22
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: <https://mailarchive.ietf.org/arch/browse/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: Mon, 23 Oct 2017 21:43:50 -0000

On Fri, Oct 20, 2017 at 3:33 PM, J. Bruce Fields <bfields@fieldses.org> wrote:
> On Wed, Oct 18, 2017 at 05:22:08PM -0400, Olga Kornievskaia wrote:
>> On Tue, Feb 28, 2017 at 12:32 PM, J. Bruce Fields <bfields@fieldses.org> wrote:
>> > On Tue, Feb 28, 2017 at 05:04:27PM +0000, Adamson, Andy wrote:
>> >> I also thought that bytes copied is only included in the success case – but as Olga pointed out, not true. The coa_status of NFS4_OK has the coa_resok4->wr_count showing the bytes copied, and the default (e.g. failure cases) has the coa_bytes_copied.
>> >>
>> >> So the server can send a CB_OFFLOAD with an error (such as the –EINVAL in the example) and send the bytes copied in coa_bytes_copied.
>> >>
>> >>    union offload_info4 switch (nfsstat4 coa_status) {
>> >>    case NFS4_OK:
>> >>            write_response4 coa_resok4;
>> >>    default:
>> >>            length4         coa_bytes_copied;
>> >>    };
>> >
>> > Gah, I'm sorry, Olga said CB_OFFLOAD but for some reason I was looking
>> > at COPY.
>> >
>> > I have no idea what to think of that.  I don't see why it should be
>> > different from COPY.
>>
>> I'd like to resurrect this thread...
>>
>> This discussion was initiated to allow for the server to do a partial
>> copy instead of failing the copy with EINVAL when copy is requested
>> beyond the end of the file.
>>
>> However, the problem I'm running into is that because CB_OFFLOAD only
>> returns "coa_bytes_copied" and does not include stable_how and
>> verifier. So even if client were to then send a COMMIT for the bytes
>> that were copied, it has no verifier to match from the COMMIT to
>> anything.
>>
>> Should the client then ignore the lack of the matching verifier and
>> just assume the data was committed for the partial bytes?
>
> Yes, sounds like in the asynchronous case the server has to wait for the
> writes to reach disk before calling CB_OFFLOAD.  (Do we currently do
> that?).

Why? No the spec does not require the server to do no such thing. The
server sends back in CB_OFFLOAD if the bytes were written as UNSTABLE
or FILE_SYNC.

> In theory that shouldn't be too expensive because asynchronous COPY
> should normally be done with a very large range.
>
> (I wonder if the server should just do a synchronous copy if the copy
> would be less than a few megs?)

Yes the server could determine to convert an asynchronous copy into a
synchronous one based on size.

I guess I'm still confused how to handle the implementation so that it
doesn't kill interoperability with other possible (future)
implementations...