Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uEBS2-004B6d-QO for pgsql-hackers@arkaria.postgresql.org; Sun, 11 May 2025 18:31:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uEBS1-00ApsT-GJ for pgsql-hackers@arkaria.postgresql.org; Sun, 11 May 2025 18:31:01 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uEBS0-00ApsH-I3 for pgsql-hackers@lists.postgresql.org; Sun, 11 May 2025 18:31:01 +0000 Received: from fhigh-b4-smtp.messagingengine.com ([202.12.124.155]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uEBRx-001Iqp-2V for pgsql-hackers@lists.postgresql.org; Sun, 11 May 2025 18:30:59 +0000 Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfhigh.stl.internal (Postfix) with ESMTP id 092CE25400B3 for ; Sun, 11 May 2025 14:30:57 -0400 (EDT) Received: from phl-imap-04 ([10.202.2.82]) by phl-compute-01.internal (MEProxy); Sun, 11 May 2025 14:30:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=barre.sh; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1746988256; x=1747074656; bh=R3s1bx+kF64DEGO8FdO0MYHv0SZO4hrWuYlM/md782A=; b= LRZbgQo0mgsgOlIXvqFhEmgJKvliY8cNvsHtU+A6YgRR0a2qq8mBJKutvXKFrWkl OmCC0GCJrz0g+h0Y8fZJXewF26geHu9o+ZliNPufc3Ned6ziWbV15yivjfKulmXW 76g4n0n3BQn5b+wHCfoq9O1N7m8elWkY3Aq8LIbP9qrZdjhJlJlxROcFnLTlPsju yp9RyIozq0vvQci5HEc5bHbQ+OXTbFsbRnjFf2kA5AZva1xTxPd9UB+oh/N1oL3h iQuVdlD/k1rbEa89hwEej7kQAzx3tqP4o++IT0ZJNMy5/88f+jZtYJJNTVEvqCWU IH8IqbJiFecEnKgR+MLBgQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding: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:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1746988256; x=1747074656; bh=R 3s1bx+kF64DEGO8FdO0MYHv0SZO4hrWuYlM/md782A=; b=hwTh4O9hvo0PI0oLG WjmHslj8xmVqf/TmkLMMvnPTiBDkw0NOxPGNEOsewqtIyvc9phLjbQzpamGnKGkI w82Q3EVDFkTn1nt/yMtrG2mjsc9zQxnu45I7B8TKqtZZoFPvbUmTfloh9QqI4oRX jA0uayBk1oX315464sUH81lifiIgrsasfSYpLHk6YM6iNhsNy1zmXA3We/oNriFu iOW1xO3+xAJJIwTvccFm1I44XUk5kc8Zcg6/x4sfB9FK5giEeOsAtcFnrQX8GJrk wb9qAGLjf7GVnzLu9LFwYgg9NfPosXeOWeE1kMZCNwnVWIDrqWblCjK+4NajuR9q Djndw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvleeluddtucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefogg ffhffvkfgjfhfutgfgsehtjeertdertddtnecuhfhrohhmpedfrfhivghrrhgvuceurghr rhgvfdcuoehpihgvrhhrvgessggrrhhrvgdrshhhqeenucggtffrrghtthgvrhhnpeevue ekueefgfdvuefhfefgtdefleegjeevheduheduieelhfekudeuuedvkedvleenucffohhm rghinhepphhoshhtghhrvghsqhhlrdhorhhgpdhlrghunhgthhhprggurdhnvghtnecuve hluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhivghrrhgv segsrghrrhgvrdhshhdpnhgspghrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpd hrtghpthhtohepphhgshhqlhdqhhgrtghkvghrsheslhhishhtshdrphhoshhtghhrvghs qhhlrdhorhhg X-ME-Proxy: Feedback-ID: i97614980:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 993BB2E60088; Sun, 11 May 2025 14:30:56 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 X-ThreadId: T5ab6830d36633199 Date: Sun, 11 May 2025 20:30:34 +0200 From: "Pierre Barre" To: pgsql-hackers@lists.postgresql.org Message-Id: <3c41a311-1438-4d45-b3f9-738650bdf38d@app.fastmail.com> In-Reply-To: References: Subject: Re: FileFallocate misbehaving on XFS Content-Type: text/plain Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello, I was running into the same thing, and the fix for me was mounting xfs with -o inodes64 Best, Pierre On Mon, Dec 9, 2024, at 08:34, Michael Harris wrote: > Hello PG Hackers > > Our application has recently migrated to PG16, and we have experienced > some failed upgrades. The upgrades are performed using pg_upgrade and > have failed during the phase where the schema is restored into the new > cluster, with the following error: > > pg_restore: error: could not execute query: ERROR: could not extend > file "pg_tblspc/16401/PG_16_202307071/17643/1249.1" with > FileFallocate(): No space left on device > HINT: Check free disk space. > > This has happened multiple times on different servers, and in each > case there was plenty of free space available. > > We found this thread describing similar issues: > > https://www.postgresql.org/message-id/flat/AS1PR05MB91059AC8B525910A5FCD6E699F9A2%40AS1PR05MB9105.eurprd05.prod.outlook.com > > As is the case in that thread, all of the affected databases are using XFS. > > One of my colleagues built postgres from source with > HAVE_POSIX_FALLOCATE not defined, and using that build he was able to > complete the pg_upgrade, and then switched to a stock postgres build > after the upgrade. However, as you might expect, after the upgrade we > have experienced similar errors during regular operation. We make > heavy use of COPY, which is mentioned in the above discussion as > pre-allocating files. > > We have seen this on both Rocky Linux 8 (kernel 4.18.0) and Rocky > Linux 9 (Kernel 5.14.0). > > I am wondering if this bug might be related: > https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1791323 > >> When given an offset of 0 and a length, fallocate (man 2 fallocate) reports ENOSPC if the size of the file + the length to be allocated is greater than the available space. > > There is a reproduction procedure at the bottom of the above ubuntu > thread, and using that procedure I get the same results on both kernel > 4.18.0 and 5.14.0. > When calling fallocate with offset zero on an existing file, I get > enospc even if I am only requesting the same amount of space as the > file already has. > If I repeat the experiment with ext4 I don't get that behaviour. > > On a surface examination of the code paths leading to the > FileFallocate call, it does not look like it should be trying to > allocate already allocated space, but I might have missed something > there. > > Is this already being looked into? > > Thanks in advance, > > Cheers > Mike