[nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operations
Trond Myklebust <trondmy@hammerspace.com> Tue, 20 August 2024 22:50 UTC
Return-Path: <trondmy@hammerspace.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 31D2CC1840E7 for <nfsv4@ietfa.amsl.com>; Tue, 20 Aug 2024 15:50:36 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.108
X-Spam-Level:
X-Spam-Status: No, score=-7.108 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=hammerspace.com
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 pQzDV2nvCHbg for <nfsv4@ietfa.amsl.com>; Tue, 20 Aug 2024 15:50:32 -0700 (PDT)
Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2116.outbound.protection.outlook.com [40.107.223.116]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 1AE87C1840EC for <nfsv4@ietf.org>; Tue, 20 Aug 2024 15:50:32 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wU0Fjoz2XR/ajX7p0SHQgBg4P4FYqP79GT+uu4TN6XU/gCfUIOUzkTPrghXIVNMXxpthcxPEkPQVm+Z8VPzYjxBh8KFkmXah12/gfJC1LRtEC6BUfQ3e4q8yW5jcvr7WBNfoi4G2gy5r8zoOsb4zwMApFFmzrL6j0GngvoQqsme02/qJMXe/yRgJyVGdReVjl3ujC8ELyOWqKlYnJRug08/Ms3rAAYpGYGRAeFTnoNvgdkVQxvYBDnbeVmnJU8f+7apT7K/U6YMUCH0FGudFvi6jEzGs1kWxzZPTn4hz5uyNRZhFQVSN0rDEOQ1RgI+yHKLTLNbyAj5s2AKo7RgjRg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=LC9dIdCUZnQEILnBnTIXOS5x6ZxOVuwF1VrF2moCgpc=; b=Y+mBTv1XIhfj6nKwkxWEzwPmh1S8KQt3r9f6zySE4HuiEKwBLNM9BglHsAo8HyxgZ63KxOQbScDZ9I6IPvuX5It2Jl+jeicu2xmIapdAUBsgQ9pJLuI5MAyzYJd21GZqF5fyXPmpZXunqA7YQBW6zR+zjlhiYv6+ObWAa8zic67jUtYtkbvQR561qXQWt4h0qT81GSXqPoCzkxCqzEXx9WifmyVQh7FmXcYVSoPPwixHKLjIxp9MlGdQhJj2nRyIczHHOjvUZFC6e0XLLgsnZ0uepoVHeUtctSezKKQP5fRd2Nm8EU9vDAvazIJ4pMUflhvhNmluihQgNvyPBgqJqg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=hammerspace.com; dmarc=pass action=none header.from=hammerspace.com; dkim=pass header.d=hammerspace.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hammerspace.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LC9dIdCUZnQEILnBnTIXOS5x6ZxOVuwF1VrF2moCgpc=; b=E/ZS8CkWDOnm95GIn1oyuPcXLzDkzbuq+Ji/VO8X8V6VO4FTjNn6SkV3PQ47EsnltPmfwv8QtQPCsHk9xUQzMyyOM6ChmXTND9OkvXK2n/4acF3OczECABvR6x+ILcAAS+2BseC7NKpBifXJgjPe6zB1g4eoJWZ2qnUK7ZMDwbg=
Received: from CH0PR13MB5084.namprd13.prod.outlook.com (2603:10b6:610:111::7) by MWHPR13MB7106.namprd13.prod.outlook.com (2603:10b6:303:282::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Tue, 20 Aug 2024 22:50:30 +0000
Received: from CH0PR13MB5084.namprd13.prod.outlook.com ([fe80::67bb:bacd:2321:1ecb]) by CH0PR13MB5084.namprd13.prod.outlook.com ([fe80::67bb:bacd:2321:1ecb%4]) with mapi id 15.20.7875.019; Tue, 20 Aug 2024 22:50:29 +0000
From: Trond Myklebust <trondmy@hammerspace.com>
To: "rick.macklem@gmail.com" <rick.macklem@gmail.com>, "nfsv4@ietf.org" <nfsv4@ietf.org>
Thread-Topic: [nfsv4] RFC: new MUTEX_BEGIN/MUTEX_END operations
Thread-Index: AQHa81Na3WhNcEfud0CHsdQVD4be0w==
Date: Tue, 20 Aug 2024 22:50:29 +0000
Message-ID: <022dcfb8ca2e484400b7a9a3e79682eda95a7009.camel@hammerspace.com>
References: <CAM5tNy7g+YCiiZQD7G6Ryv_Mo8N5BeRiqMP=224zPpEXa+Yi+A@mail.gmail.com>
In-Reply-To: <CAM5tNy7g+YCiiZQD7G6Ryv_Mo8N5BeRiqMP=224zPpEXa+Yi+A@mail.gmail.com>
Accept-Language: en-US, en-GB
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=hammerspace.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: CH0PR13MB5084:EE_|MWHPR13MB7106:EE_
x-ms-office365-filtering-correlation-id: 87dff061-cf0e-4af3-e9d5-08dcc16a7d68
x-ms-exchange-atpmessageproperties: SA
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;ARA:13230040|376014|1800799024|366016|38070700018;
x-microsoft-antispam-message-info: xbDf7FRDYG+SxRnrh9phf2+3LT3KrjXtBLpe5X2yHZQbjPPi4fPh7Dh7rFPv4bqWP88ABEVus53P3PIC1ziOgo8DjEDpO6B7FlK/yTUD9uclPHBIjebTMk4clGT3ZISBURVJ2qjXt120udHdiGHdHbqY5oFduSx/w7I+mcS3YsLk5chyAlUF2Hts+869Yfi6udmPZpAYMkCjnifRiTgJ9c7g8KlbCjEtAIutAy9fmIHzBCtrigslIJ6bERAzakxgtPhJ+JCg9TcjvC50CbgXP2XkHxW8rjZaPGzYD+ENHw3PQDj9XI9vaEWVs54eEjfkG4nKgiyH05EYkJUvypvQ93rZkTZIkLLjnFWmiWpemUH6x3TOknTVhosGCepw2Z0nllnG8vSpkFJs3jAPGCE/sPwlR1THehWzGlS8m+z7xUsrsmjnXXNN94sdN2W2Bk3xOvL7zSHeoMYCsTkaVJnGhha3SxHDYcp4Lo5QxH3+MzFv4fUumHAyT9pCsy312UJbnhG9rQteQzymdVt8BpE52EHm3CGK/6OX8tmZpm+XC0o73X86Y+qMsbnFfqR27QjN7SV6b4goqmKtXp74TEeWIgJSt4V0n06UkX7QOO1AwlVWfl/1XMKyHwMVKGSbVA2YMqVhgLKXvTteiNr8yupk6A7JsfEGihCbF8SgFFvRSkS1/QwW3IuEk2NfuFzDX8ipRjSaD0clx8JWJY9Iv6jCfhADTX9lLyRRt2woJlbuTLU+OzauztJYJFhGjhfIgr9wvmRX/7opjNgM+kaCrcALbzXiO8y/uetJZSbu2ldmG2OuojJO09zPO9yXbDSyaZ9UPkkqZ8UtH/WYRcpIRUUKr01hFb3DPpNwv5zYWXEHIegRsS7xVKyRIFxBH+lCF1Y8muqpaTvN81XpmCSLCTTFqP9vc8wtd6JGLgPMTtwLMqBCmO2hKWl/PglkPKNPn4W4OZ1A/XuxBB4PGq9eCL5bsHFkvlTOtKYyCEINjtY0ag6PDPsZT3YvADlAdKIxV0eIhxQ4CwUk6s8t/2lZungHo22npCQFuR/3nGdtiGfqdg6+XYOOFjbpKDPxDSGJpiAJtdKYBGAW38HGvwtRJZssxRqMU2Md+/WBfs0caw8ty50qw930064hJdjBOMag4oRYpof+T8DRip2ByB3al8p5A3qq7gGWhlvLoBTUa6DsiMPQoujg5x24DUqcmIK5WSBBqIO0hZedh1xdLTATB9rEBB8iAOalEOhaya/slfr69KbF6qXVyedbKhS/P1yYODXNoVRwL+yLbNyCve49oma6ro6pZve9WZtBjgrxXo6mT8Ls3+LEAD47P3u50mtYZkk7X9saAacel3aq3OE1uCZU50uxHYxWMuZZ0kRM/8hIVlFWeWmEmaYKKoR2uyNlrT3WOq4VMSZEoc1G3xWT88FfhA==
x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR13MB5084.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(1800799024)(366016)(38070700018);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: STmn9BxCJx5ISvO7byA3K5JjkxNsv9CXpg9dQluaQ2rF6IqnyXuDGqiAYcu/9LEbm9M3CknBbWXEntnRcv6O4FpAVeUrcYqnqNOBFknCDMhTXVK1//UqQnp1YFkFM6dor2byQ2QRvWZ29r2yZrMkwObLDJi3HFjRjpysSJdeuoS+fy2mrgHSSGckXQ5MHRQycmEYE4wkwrizGdByXPd/u1MODIorkYkvzjHac6QI2vSHKVN8jwWr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gPz1nuJ8llA775x5nMkPUI8ar6AcXrsdtkTzjJKRo/oW1+amN8s7hgYbLcxN6RPIevfHiAu8EZr/FbNSyB2aDBkqBDO+LvTnBFh7x0IDIT6dHDHLRMytyiK7UNu4SGJbgBjtlkitfB+Szhcyn3wOXAXd+HCDxb9zZnSkF48Bwm2B6EMrVQ2DB9TEKYnZ0bGh9jb7D1VRlaIar7HL8p1tNxlPvk3Qm2WFn956DDXCd/BojFMsvejNnk7Cv483CVaDk2Ijr4/79bcd70m1CvBtwbURjFlqBKhYWOJgB5b0caX027yZjr3C1b8jHWtoFDzpA1yiNg/rYkrAW0Hjwl3SXHDyfSXV8DGzw/Se4JHEFDIA==
Content-Type: multipart/alternative; boundary="_000_022dcfb8ca2e484400b7a9a3e79682eda95a7009camelhammerspac_"
MIME-Version: 1.0
X-OriginatorOrg: hammerspace.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: CH0PR13MB5084.namprd13.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 87dff061-cf0e-4af3-e9d5-08dcc16a7d68
X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Aug 2024 22:50:29.4091 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 0d4fed5c-3a70-46fe-9430-ece41741f59e
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: Ix577ztcK8ZN810DW3/jyGWEKpY1HEtIhr1owafeeYLvPSqQPs7ao3jrw9p36b/7Xdi//y8V38+TW7/gzfDLSA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR13MB7106
Message-ID-Hash: ZNUYBIBY7C2VUKJQ6WQ6EIKLOH3ZLUVG
X-Message-ID-Hash: ZNUYBIBY7C2VUKJQ6WQ6EIKLOH3ZLUVG
X-MailFrom: trondmy@hammerspace.com
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-nfsv4.ietf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
X-Mailman-Version: 3.3.9rc4
Precedence: list
Subject: [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operations
List-Id: NFSv4 Working Group <nfsv4.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/nfsv4/YjW_SoBBDBqZsPxVjVRGs5Ma2d4>
List-Archive: <https://mailarchive.ietf.org/arch/browse/nfsv4>
List-Help: <mailto:nfsv4-request@ietf.org?subject=help>
List-Owner: <mailto:nfsv4-owner@ietf.org>
List-Post: <mailto:nfsv4@ietf.org>
List-Subscribe: <mailto:nfsv4-join@ietf.org>
List-Unsubscribe: <mailto:nfsv4-leave@ietf.org>
On Thu, 2024-08-08 at 13:36 -0700, Rick Macklem wrote: Hi, Over the years, I've run into cases where it would be really nice to be able to perform multiple NFSv4 operations on a file without other operations done by other clients "gumming up the works" by changing the file's data/metadata between the operations in the compound. So, what do others think about an extension to NFSv4.2 that adds 2 new operations: MUTEX_BEGIN(CFH) MUTEX_END(CFH) Both would use the CFH as argument, and no other client would be allowed to perform operations on the CFH between the MUTEX_BEGIN and MUTEX_END. I think there would need to be a couple of properties for these: - There would need to be an "implicit" MUTEX_END when any operation between MUTEX_BEGIN and MUTEX_END returns a status other than NFS_OK. - I think you would want a restriction of only one mutex for one CFH at a time in a compound. Without that, there could easily be deadlocks caused by other compounds acquiring mutexes on the same CFHs in a different order. - Only one compound can hold a mutex on a given CFH at any time. - MUTEX_BEGIN/MUTEX_END can only be used in compounds where SEQUENCE is the first operation. - All mutexes are discarded by a server when it crashes/recovers. (Any time a client receives a NFS4ERR_STALE_CLIENTID.) That way RPC retries after a server reboot should work ok, I think? I think you also need to apply: - The mutex is discarded as soon as the COMPOUND completes. Otherwise, you're relying on the client to be a good citizen and clean up if one of the operations in the COMPOUND generated an error. I am not sure what the semantics for reading data/metadata should be, but I was thinking that would be allowed to be done by compounds for other clients for the CFH. If a client wanted to serialize against other compounds for the CFH, it could do a MUTEX_BEGIN/MUTEX_END. I see this as useful in a variety of ways: - The example in the previous email of: MUTEX_BEGIN NVERIFY acl_truform ACL_MODEL_NFS4 SETATTR posix_access_acl MUTEX_END - Append writing: MUTEX_BEGIN VERIFY size "offset in WRITE that follows" WRITE "offset" etc MUTEX_END - A bunch of cases where NFSv4 lacks the postop_attributes that were in NFSv3. MUTEX_BEGIN WRITE GETATTR size, change,.. MUTEX_END So, what do others think? (This was obviously not possible without sessions.) Questions: What happens in the case where another client holds a write delegation? Do you recall the delegation? I think you must, since the client is otherwise authoritative for some of these attributes that you want to keep stable. What happens if a pNFS layout is outstanding? Do you recall the layout? Again, I think you have to, since otherwise you cannot guarantee exclusive access or attribute stability. Speaking of pNFS, how do you ensure that the above WRITE+GETATTR is possible for clients that are using pNFS? Do we need a 'LAYOUTGET_WITH_MUTEX' operation? Since layouts are recallable, it might be possible... -- Trond Myklebust Linux NFS client maintainer, Hammerspace trond.myklebust@hammerspace.com<mailto:trond.myklebust@primarydata.com>
- [nfsv4] RFC: new MUTEX_BEGIN/MUTEX_END operations Rick Macklem
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Rick Macklem
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Tom Haynes
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Rick Macklem
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Pali Rohár
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Rick Macklem
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Chuck Lever III
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Jeff Layton
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Pali Rohár
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Rick Macklem
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Rick Macklem
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Jeff Layton
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Jeff Layton
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Rick Macklem
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Rick Macklem
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Jeff Layton
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Rick Macklem
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Pali Rohár
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Rick Macklem
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Trond Myklebust
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Rick Macklem
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Rick Macklem