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 1sortb-00EOsb-Sm for pgsql-general@arkaria.postgresql.org; Thu, 12 Sep 2024 22:02:36 +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 1sortb-001R4L-Gq for pgsql-general@arkaria.postgresql.org; Thu, 12 Sep 2024 22:02:35 +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 1sortb-001R3h-5k for pgsql-general@lists.postgresql.org; Thu, 12 Sep 2024 22:02:35 +0000 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sortY-000rkz-28 for pgsql-general@lists.postgresql.org; Thu, 12 Sep 2024 22:02:33 +0000 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-a8d2bd7dcd4so16258766b.3 for ; Thu, 12 Sep 2024 15:02:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726178551; x=1726783351; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=bc0eEz/w1SlXdFxtFW4N0HOO7kWpJeqFxa84M2QMWaM=; b=btHhtL9juwADRE5eYuw2sSmRgjRGjMVWRUbpw/7FbWNfvJ7cxIlrSPD46107xjHNaq EozwU6zk2bp5LWO/ZUyP6adgXHrlvUnvXx9pM3FFTmkskWKuOL2x4VGsnhxbR5n3hN87 vAVyP1fMGPrxXr4aMMjSELHoLXvw6ZT31bzafD/4uw+FhYd6jW8f9SZBI7LAJxVl5rPY qRH4ym36e9M3+h/inI/Zva03ZwpFXNfbLOIwgVCJJ7lrKT6Z50JBSw1LtTQhZAzQsZyD 6oxFPwa2tRtvs2LLgHCARk5Wn7pFtry7bM+E5xpCiVaOX6lB7C9QZbH5YO7qvYpNvbCN jwsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726178551; x=1726783351; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bc0eEz/w1SlXdFxtFW4N0HOO7kWpJeqFxa84M2QMWaM=; b=cDkorypThufChH8S0U0nG/AZ6dM56knoqElct9jhrmp8nLxyT3/aknD3PnyrN8A4CT vxNAjCTM/RFC+nYnSzi318GdRANcTeRcHaJctynCKZv4G7t/ZuZlfJXsDnofTXQbMVze qCdJGSzTGOMLzspLvU7QUZomXSLJRM8Los10mfDbCnD+UO60HLnE2Zo0aYXb14EXX3fC X0sROqnsSLCyEJA0cDJ5J7+x8rTCUnL1E/A0UAcLcbD7wh1c2EvQZHE1Y//i2QsR1dP2 KMCg33dpwZG6XPK0f02314Hdnjun1o4YuFJBp8kDmrhVa07ANg5yupbTxG1aWnZ5qmy6 s8tg== X-Forwarded-Encrypted: i=1; AJvYcCXoNxWJipFV73XvuOrxUyRA3CyuGVJr28xe5ebGc4IwkpLDS2zHWfnmsGg/pFbST7ynpSGIPsRvuWZGFbeR@lists.postgresql.org X-Gm-Message-State: AOJu0Yy99OmzEA+5L0RIWUKNtJ1W8TjeHiotbn+96RJeDxJAuk0zBPZC p9WYP4Lj+O1IULaxasvHC0BPRkE45+hIGSAcqsg357NbkfgwgGQtW+X0wvvVtZOou+VX+jN65W6 T8I3nCsGeuHiBEo/RYduM19rkmjI= X-Google-Smtp-Source: AGHT+IFs8I5gkTSFH8du9Oic6gzTHbhGc3n741hHd8Lia1rRW5zjpGKwrvAx9mYr30uwgYnOBOfndAFk/V/brJTbrpg= X-Received: by 2002:a17:907:3eaa:b0:a8d:4410:3bd6 with SMTP id a640c23a62f3a-a902946b6e2mr182541366b.4.1726178550333; Thu, 12 Sep 2024 15:02:30 -0700 (PDT) MIME-Version: 1.0 References: <202409111239.n2dybum5hcwj@alvherre.pgsql> In-Reply-To: From: Thomas Munro Date: Fri, 13 Sep 2024 10:01:53 +1200 Message-ID: Subject: Re: Error:could not extend file " with FileFallocate(): No space left on device To: =?UTF-8?B?UGVjc8O2ayBKw6Fu?= Cc: Alvaro Herrera , "pgsql-general@lists.postgresql.org" , Andres Freund Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Sep 12, 2024 at 8:54=E2=80=AFPM Pecs=C3=B6k J=C3=A1n wrote: > In link you provided there is mention, that in PostgreSQL 16 data is not = being > compressed for PostgreSQL 16 server. Does it mean, that PosgreSQL 16 use = much more space while computing queries? > If that is the case, it can be our problem, because our queries use somet= imes several TB of disk space for computation and if there is considerable = increase in disk usage during the queries, it can happen, that sometimes 27= TB is not enough. The kind of compression discussed there is a btrfs feature. Xfs doesn't have compression. > I have 2 questions, > > Is there any workaround, that Posgres wont use FileFallocate? Maybe set s= omething in Linux not to allow Posgres to use it? Not currently. I was thinking of proposing to introduce a setting and back-patching it into 16, because it's a sort of regression for btrfs users (and a hard one to foresee). It is not at all clear what exactly is happening on this xfs system, but something else... > The change was introduced in Posgres 16, does it mean, that Posgres 15.8 = should have old behaviour? Yes. > We dont use COPY in our queries. OK so it's presumably due to having lots of concurrent DML operations (most likely INSERT, could also be UPDATE) that need to extend the relation. I'm not sure of the exact behaviour of the heuristics off the top of my head (but basically it's driven by waitcount[1])... perhaps if you had only 7 concurrent DML operations and not 8+, it would be less likely to take the fallocate path, something like that... That "8" is the threshold I was thinking of turning into a GUC, perhaps in the November minor release, but it's not exactly clear that posix_fallocate() is really the problem. (I see that there have been bugs in xfs's posix_fallocate() space accounting, but the one that I found was about redundant posix_fallocate() over a region that is already allocated, which PostgreSQL doesn't do.) However it is far from clear what is actually going wrong here. Although it seems to imply a pretty weird/bogus use of ENOSPC by the kernel, that link I posted seems to be hinting that something a bit different is going on. It may be clutching at straws, but you might try increasing those ulimits. I'm not sure how to try to reproduce it in lab conditions since it's apparently pretty hard to hit, based on your 1-2 week MTBF on what sounds like a massive and busy system. Hmm... [1] https://github.com/postgres/postgres/commit/00d1e02be24987180115e371aba= eb84738257ae2