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 1soV1v-00Bhwj-MN for pgsql-general@arkaria.postgresql.org; Wed, 11 Sep 2024 21:37:40 +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 1soV1u-008X2p-Ls for pgsql-general@arkaria.postgresql.org; Wed, 11 Sep 2024 21:37:38 +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 1soV1u-008X1X-7C for pgsql-general@lists.postgresql.org; Wed, 11 Sep 2024 21:37:38 +0000 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1soV1l-000hGN-Kg for pgsql-general@lists.postgresql.org; Wed, 11 Sep 2024 21:37:35 +0000 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-5c26fd60b7bso23744a12.1 for ; Wed, 11 Sep 2024 14:37:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726090648; x=1726695448; 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=rC1KAj7ZuGop/5AWsJeUwWbM3gzNRhXIr8Qhd6Dlvfg=; b=hrJ/WZI67lXK+hGNhVoFxR5b5fyztn60Tenb93B6VXTL/rVq8RMxX4uWEdCTfVs4iq 5pi+CzXtx78m9bxBMRC41Mn8snGiyOedAWuW+23+giayLUDaOWn/Do+bfl5doPbKqrds vi1ywyTMddBwHLN7M+dn/mZaTWE1lb2LQZhSiBlnddC+LJY+bOeYOKByTrVcN1gL0vx0 +ywmG2gryphoV7xY0hAfjLcTpgNK+mRuxI7z7JelhJHcEvH31NeF8m9QIkvKnpgjALfR 1oQF4ESReXq6xmpGWlfv2sGl+jEJ6W+2r93aguyu43wbCa+N+Ijqf1kwILiXmp9xwaHV iu7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726090648; x=1726695448; 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=rC1KAj7ZuGop/5AWsJeUwWbM3gzNRhXIr8Qhd6Dlvfg=; b=kTzxfVLjDtf2tjlSrnbzjSDIqjFgiTyWbULmfi7sn6u58CMhnBFYYNps6XvLUoJbXP sBtPwZ9sB3A1xgLhvVr1zLYqjZy27Loy/0rH9qTk8elp+mJeF0p6OKZPqaDnGLzCY3DE sJgtO5Ko+60Tzt66fzhsy8aH8tMc9qqb99738Ib3xgXzWXpSjU5d/fjGSNpZtGIOImgx sYXgmI/SsL0K1TIOqo9cCTcXgWVhlixLYVF3vl/OTPCbyjJCZuD7fIUxZ48rLqr/S6c+ kV+FrcUhVePI+S9ap3+Hppcs/FCXwOg60xWATm+jd1RVHIaY6Lq4Ft2N5LyARaItB+l/ Pi1A== X-Forwarded-Encrypted: i=1; AJvYcCVYgLVaazEjehT96FMgA9P1tHTD4kL89T/Tm9EZRNutmETwsTGYECvk/wdjbpgK6kBqFcBhY3n/Z2Q4QFRA@lists.postgresql.org X-Gm-Message-State: AOJu0YwtdoNYlEwN5jxeL+TS8ReOkC59tNZ2cpoXRfBPMQ9fqZG8gtXD uXWoN7sGEBby+UyFI/KZi6XLoWGJDeaum/6QLorOG3qmNxWhDUYYWsI7sL6c6SWn7SlTw5tXm/t HKSdJxwG5adcuQNoxsyNnUfZGj9ML1tSlGE4= X-Google-Smtp-Source: AGHT+IHJPwucnG+FbqrqMzAMJmFTq+F0NUHHx0E1Dd/GQdMjNgpZ+87BZNiIqW74eenULnhV+CJPa2BFNqc7ZRDS9ik= X-Received: by 2002:a05:6402:50cf:b0:5c3:c42e:d60e with SMTP id 4fb4d7f45d1cf-5c413cbb3b3mr264246a12.0.1726090647490; Wed, 11 Sep 2024 14:37:27 -0700 (PDT) MIME-Version: 1.0 References: <202409111239.n2dybum5hcwj@alvherre.pgsql> In-Reply-To: <202409111239.n2dybum5hcwj@alvherre.pgsql> From: Thomas Munro Date: Thu, 12 Sep 2024 09:36:50 +1200 Message-ID: Subject: Re: Error:could not extend file " with FileFallocate(): No space left on device To: Alvaro Herrera Cc: =?UTF-8?B?UGVjc8O2ayBKw6Fu?= , "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 12:39=E2=80=AFAM Alvaro Herrera wrote: >> On 2024-Sep-11, Pecs=C3=B6k J=C3=A1n wrote: > > In our case: > > Kernel: Linux version 4.18.0-513.18.1.el8_9.ppc64le (mockbuild@ppc-hv-1= 3.build.eng.rdu2.redhat.com) (gcc version 8.5.0 20210514 (Red Hat 8.5.0-20)= (GCC)) #1 SMP Thu Feb 1 02:52:53 EST 2024 > > File syst=C3=A9m type:xfs > > Can you please share the output of xfs_info for the filesystem(s) used? > > Apparently, it's possible for allocation groups to be suboptimally laid > out in a way that leads to ENOSPC with space still available. Hmm, I have no clues about that, though I do remember reports of spurious ENOSPC errors from xfs many years ago on some other database I was around maybe in the era of that kernel or a bit older. Actually I was already wondering if we need to add a tunable to control that the heuristic that redirects to posix_fallocate(): https://www.postgresql.org/message-id/flat/CAMazQQfp%2B3f8tD_Q23rCR%3DO%2BJ= j4jouSRVigbD8OmrTOfHV%2B8gA%40mail.gmail.com There's no confirmation that writing zeros would be a useful workaround here, though. Two things changed in 16: the fallocate() path was invented, but also we started extending by more than one block at a time, which might take the pwritev() path or the fallocate() path, for bulk insertion via COPY. That btrfs user would prefer pwritev() always IIRC, but if some version of xfs is alergic to this pattern I don't know if it's the size or the system call that's triggering it... Is COPY used here? And just for curiosity (I don't see any particular connection or what to do about it either way in the short term), are we talking about really big tables with lots of 1GB files named N.1, N.2, N.3, ... files, or millions of smaller tables? I kinda wonder if xfs (and any file system really) would really prefer us to use large files instead (patches exist for this), and when many-terabyte clusters start working with huge numbers of segments, we reach fun new kinds of internal resource exhaustion, or something like that.... . o O { I particularly dislike our habit of synthesising fake ENOSPC errors in a few code paths... grumble }