Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pr6MD-0000HW-9c for pgsql-hackers@arkaria.postgresql.org; Tue, 25 Apr 2023 00:16:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pr6MB-0003dN-J2 for pgsql-hackers@arkaria.postgresql.org; Tue, 25 Apr 2023 00:16:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pr6MB-0003dE-86 for pgsql-hackers@lists.postgresql.org; Tue, 25 Apr 2023 00:16:31 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pr6M8-004tDD-Cw for pgsql-hackers@lists.postgresql.org; Tue, 25 Apr 2023 00:16:30 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id BB6D33200944; Mon, 24 Apr 2023 20:16:25 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 24 Apr 2023 20:16:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1682381785; x=1682468185; bh=g6 jdXx5GzUm7wVZQMPmNE0yZiZxbG0gU4SQ2JEGzx6s=; b=nrfQZrV1cqlIcT8+GF ue4tNN5AmpOc1qAm7VsnAS5qcAZxuJanRrcAQ6pm32JdxetblGOJtI28eoWVJ6/O /sTKH47ZAdxeaGRCukqkh70tjQ9RuKnzmWr3CITftaaU3JjyAdD7f1WqZEIckeHC rLMrZ6DzCjTIY3w105M6U7ifS4BaZkvhmvoBe3VD7poravrkoXSEUHGmEEOfSW5J LTMrZl7VY+K/ejVaohHsNjkre7F7c816kP6oTH1/f+fRrPlH5o4vYUwbqUniRRrO 6zR9vtMV87u+5/UEz5rnVWKGEIkd06oOBNuCC2GROUPTww4QQds3g1NHY9g89usU 12gw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1682381785; x=1682468185; bh=g6jdXx5GzUm7w VZQMPmNE0yZiZxbG0gU4SQ2JEGzx6s=; b=adQa0Tle7g/nTdQJhEn7p6ndavnpU k73FezYrTYhJnSlxcuexRDnjxfiLUGSuosvPTRydOjUOWRcvhrY7dm0a0KjywtM8 ZqvjGOuAsWg7J0z1v9aZmjnbvEtkikjbjTDryhX7zOhNF0OTmZLhc21W4cPhu41E RlaHtV6PzFqwNBVSqjbiGHM2MjecRG9jr3xpo1ipI/+l2hhnsRiwC7Lckc0gO5as H2cE7yf1sSmZgyyTfK4N+JgW0By/P+cveztrGljN33HQIL3agERJT0dHT1AGAjG8 o5AXHZYE/u1FQbEnXzhdwWW7KPYldgb1zUE4NUpNHlVRPh2lVIrUN5KPg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeduuddgfeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesmhdtreertddtvdenucfhrhhomheptehnughr vghsucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrf grthhtvghrnhepkeeiueegvedugeeutdeifeffiedvgfeugeekhfeftdevfeekffelgfeg vefhudejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh eprghnughrvghssegrnhgrrhgriigvlhdruggv X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 24 Apr 2023 20:16:24 -0400 (EDT) Date: Mon, 24 Apr 2023 17:16:23 -0700 From: Andres Freund To: Christoph Berg , Thomas Munro Cc: pgsql-hackers@lists.postgresql.org Subject: Re: could not extend file "base/5/3501" with FileFallocate(): Interrupted system call Message-ID: <20230425001623.im5uquriqlk4ayy6@awork3.anarazel.de> References: <20230424223225.gle3x3sw5m4div2l@awork3.anarazel.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="hfuy3uja5qh36y7g" Content-Disposition: inline In-Reply-To: <20230424223225.gle3x3sw5m4div2l@awork3.anarazel.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --hfuy3uja5qh36y7g Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, On 2023-04-24 15:32:25 -0700, Andres Freund wrote: > On 2023-04-24 10:53:35 +0200, Christoph Berg wrote: > > I'm often seeing PG16 builds erroring out in the pgbench tests: > > I don't think the disk is full since it's always hitting that same > > spot, on some of the builds: > > Yea, the EINTR pretty clearly indicates that it's not really out-of-space. FWIW, I tried to reproduce this, without success - not too surprising, I assume it's rather timing dependent. > We obviously can add a retry loop to FileFallocate(), similar to what's > already present e.g. in FileRead(). But I wonder if we shouldn't go a bit > further, and do it for all the fd.c routines where it's remotely plausible > EINTR could be returned? It's a bit silly to add EINTR retries one-by-one to > the functions. > > > The following are documented to potentially return EINTR, without fd.c having > code to retry: > > - FileWriteback() / pg_flush_data() > - FileSync() / pg_fsync() > - FileFallocate() > - FileTruncate() > > With the first two there's the added complication that it's not entirely > obvious whether it'd be better to handle this in File* or pg_*. I'd argue the > latter is a bit more sensible? A prototype of that approach is attached. I pushed the retry handling into the pg_* routines where applicable. I guess we could add pg_* routines for FileFallocate(), FilePrewarm() etc as well, but I didn't do that here. Christoph, could you verify this fixes your issue? Greetings, Andres Freund --hfuy3uja5qh36y7g Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v1-0001-fd.c-Retry-after-EINTR-in-more-places.patch"