Re: Atomic patches and network interruptions

Glenn Strauss <gs-lists-ietf-http-wg@gluelogic.com> Tue, 27 February 2024 17:11 UTC

Return-Path: <ietf-http-wg-request+bounce-httpbisa-archive-bis2juki=ietf.org@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 7D730C151086 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 27 Feb 2024 09:11:07 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.758
X-Spam-Level:
X-Spam-Status: No, score=-2.758 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=w3.org header.b="Vo7TisPV"; dkim=pass (2048-bit key) header.d=w3.org header.b="pbZKYs7c"
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0rHC6wJefWcL for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 27 Feb 2024 09:11:03 -0800 (PST)
Received: from lyra.w3.org (lyra.w3.org [128.30.52.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id F2297C151088 for <httpbisa-archive-bis2Juki@ietf.org>; Tue, 27 Feb 2024 09:10:51 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=w3.org; s=s1; h=Subject:In-Reply-To:Content-Type:Mime-Version:References:Message-ID: Cc:To:From:Date:Reply-To; bh=dSkgtxeGk6Z+vb2u8uLv7HBI+au7+hl3bJfwnsaxNbw=; b= Vo7TisPVpJfN1RdD4tcRlCwSqh0YMIkuJsyymltQVZORLEJmhMk/bK9BEkjWfTTEG7eOwNqo//Oow 8Rt0tWk2F+9n3KXx+l6cv8ujD14okyNBxaDoNubq61y2nb4gw3WsryF99Nsd+jZqxb+IL/Qlu/UmE vtv4YXyxtv0JXW0y4SoRIo5hJ2DAhUm9RDZrErf0EmvH2LaJwKm8h8mmFLP0ZoRuOsyjuw9seR9fY w1MOVeaP3Ujsig3NJcOzf3aDZ2RdfJ4xPa56mgFF7s15dMpUZ17iIVipWb1TKmmeJxFxWTsiruFSq bGo/SXM9fLYoj4Ugdj6Venv7KF/7TcREzw==;
Received: from lists by lyra.w3.org with local (Exim 4.94.2) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1rf0bG-002p7z-RI for ietf-http-wg-dist@listhub.w3.org; Tue, 27 Feb 2024 16:46:38 +0000
Resent-Date: Tue, 27 Feb 2024 16:46:38 +0000
Resent-Message-Id: <E1rf0bG-002p7z-RI@lyra.w3.org>
Received: from www-data by lyra.w3.org with local (Exim 4.94.2) (envelope-from <gs-lists-ietf-http-wg@gluelogic.com>) id 1rf0bB-002p4k-Kc for ietf-http-wg@listhub.w3.org; Tue, 27 Feb 2024 16:46:33 +0000
Received: from puck.w3.org ([34.196.82.207]) by lyra.w3.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from <gs-lists-ietf-http-wg@gluelogic.com>) id 1reiin-000Rmf-Hm for ietf-http-wg@listhub.w3.org; Mon, 26 Feb 2024 21:41:13 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=w3.org; s=s1; h=In-Reply-To:Content-Type:Mime-Version:References:Message-ID:Subject: Cc:To:From:Date:Reply-To; bh=dSkgtxeGk6Z+vb2u8uLv7HBI+au7+hl3bJfwnsaxNbw=; t=1708983673; x=1709847673; b=pbZKYs7cPFq9Pr7xcCWF7+9K3UWywv0+bQe4C1aQDnhpP99 zgSlpfgspWDaWvPG50c6n8MkYFsMlSZlOtMTFfcMISYCLr4Ve7VeOwVmB2n5f2Sn2Slrh7uI/sl8w uhXm/kCLs2gAFTjOLPsn8LQMUybDmgjR3lRnsdCtC5QJ8oxMv03LMISwRo2aw6Co7/K7KqcVWBhrN iLxgUweom1Hch1GlF1zF+k5cDgCJcAjSoZ4USXHCvP7VgYpKOWE0VYIr0hQ/kbUlCiY1eofQkVCxO inbqdTb6vwzea2+qLKrMZ0YFzco1DsMROnz1EanwMcex3D/Qegz+SYaqJPGaJMzg==;
Received-SPF: pass (puck.w3.org: domain of gluelogic.com designates 52.86.233.228 as permitted sender) client-ip=52.86.233.228; envelope-from=gs-lists-ietf-http-wg@gluelogic.com; helo=smtp1.atof.net;
Received: from smtp1.atof.net ([52.86.233.228]) by puck.w3.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (Exim 4.96) (envelope-from <gs-lists-ietf-http-wg@gluelogic.com>) id 1reiim-002E4b-2y for ietf-http-wg@w3.org; Mon, 26 Feb 2024 21:41:13 +0000
X-Spam-Language: en
X-Spam-Relay-Country:
X-Spam-DCC: B=www.nova53.net; R=smtp1.atof.net 1205; Body=1 Fuz1=1 Fuz2=1
X-Spam-RBL:
X-Spam-PYZOR: Reported 0 times.
Date: Mon, 26 Feb 2024 16:41:01 -0500
From: Glenn Strauss <gs-lists-ietf-http-wg@gluelogic.com>
To: Marius Kleidl <marius@transloadit.com>
Cc: HTTP <ietf-http-wg@w3.org>
Message-ID: <Zd0FbZzskpWX3bP0@xps13>
References: <CANY19NtcgJJhArwufG+bH0EDSy6cSw4hSaZn_J9AykJv_5pJVA@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
In-Reply-To: <CANY19NtcgJJhArwufG+bH0EDSy6cSw4hSaZn_J9AykJv_5pJVA@mail.gmail.com>
X-W3C-Hub-Spam-Status: No, score=-3.9
X-W3C-Hub-Spam-Report: BAYES_00=-1.9, DMARC_MISSING=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, W3C_AA=-1, W3C_WL=-1
X-W3C-Scan-Sig: puck.w3.org 1reiim-002E4b-2y 01b7170836e17599b6f440d00d981e8d
X-caa-id: 389b7956a9
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Atomic patches and network interruptions
Archived-At: <https://www.w3.org/mid/Zd0FbZzskpWX3bP0@xps13>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/51844
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <https://www.w3.org/email/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

On Mon, Feb 26, 2024 at 08:30:38PM +0100, Marius Kleidl wrote:
> Dear working group,
> 
> RFC 5789, which defines the PATCH method, places this requirement:
> 
> The PATCH method requests that a set of changes described in the request
> > entity be applied to the resource identified by the Request-URI. The set of
> > changes is represented in a format called a "patch document" identified by
> > a media type.
> > [...]
> > The server MUST apply the entire set of changes atomically and never
> > provide (e.g., in response to a GET during this operation) a partially
> > modified representation. If the entire patch document cannot be
> > successfully applied, then the server MUST NOT apply any of the changes.

This is very direct and very explicit.  "atomically" means exactly that.

> > If the entire patch document cannot be
> > successfully applied, then the server MUST NOT apply any of the changes.

The server MUST NOT apply an incomplete patch document.  No exceptions.

Among your options:
The client can send smaller patch documents if changes are independent.
  (recommended)
The server *application* handling the request could buffer and store the
  (partial) request body fragments, allowing for resumable uploads, and
  then apply the changes only once the entire patch document is received

> Or could this be allowed if the
> corresponding media types explicitly allows applying partial content?

More questionable: a PATCH format might be defined/extended with a new
  media-type defining a format that consists of multiple patch documents
  which may be applied independently.  The client would need some way(s)
  to query/validate which patch documents were applied.  Again, per the
  RFC, each patch document must be applied atomically; never partially.

Cheers, Glenn