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 1tKmkP-00AlE2-8c for pgsql-hackers@arkaria.postgresql.org; Mon, 09 Dec 2024 23:01:01 +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 1tKmkL-00CZCe-8G for pgsql-hackers@arkaria.postgresql.org; Mon, 09 Dec 2024 23:00:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tKmkK-00CZCK-S0 for pgsql-hackers@lists.postgresql.org; Mon, 09 Dec 2024 23:00:58 +0000 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tKmkJ-001xzo-4K for pgsql-hackers@postgresql.org; Mon, 09 Dec 2024 23:00:57 +0000 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-385f07cd1a4so3359670f8f.1 for ; Mon, 09 Dec 2024 15:00:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733785254; x=1734390054; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=J7+AgBhJoO9u/DwM5AZ5HKDZO7dwKeCH22B1jmh2fOo=; b=lKedWrCcKGnYsQo8U+DmxYSh6oEoQTsXZ69EDIIVzOIM70PfNSm/eA7p3ooH/KmAxA RosDCyYaPDnI2FfKgtFD+ZnddgcMvn8ys3UE94IlHyH1fkCkI5LYAYDdm6FAlOdnpIeO l2gTPqM0sPyyYeL8zZcFnYwUhUM9+z/5feYM84p0jf4yllD5Ju8Aoy4ndIoRifqx+mbw 2PKQcIkGFu3u0L2/0Lsmz5wfKplfP2g5WtnABDDZpRjnTimfAAlZ6ydLc7rH6u5BeHRX T+KxPxioYz3VwVOrkpBCS6QcNXmZD34NFE9m6zZFxCpMy0rT+/CyD6Hf7ekYtJDkl/yG On6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733785254; x=1734390054; h=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=J7+AgBhJoO9u/DwM5AZ5HKDZO7dwKeCH22B1jmh2fOo=; b=GvipKz/cv9+BwjDdlEwjLDVFa46eHJwSVA+L2MrEyikJlqz4qzrWMeYXLxhvXev+s/ xv5wLW5p65axpF3Zf7bJAEsiV21Qpqk+mEcXkXASIFJRpRRpi3Bs7imTwfY9c45/IGge NSTYek/BeBuKG52vNsolBx0hix5+IYW6Gy813j9yfsNee60XhH6s9+iInp1fL/D0Po1y OtT4ThzqbX65t4ixXFL5PKE3TlwLKIYPew3a6gD5fqZprr9S6FLN2xB8p1zMWNXRMi5d rY62RPnJAXJbjqnj13O3zhtK0yWTePrqdsdGf0LLVlL5yrZGFRKPGDghCtoX3ZFsTjNQ m9Sg== X-Gm-Message-State: AOJu0YyA6Hi2v6BMbwHAlc5ZkudnxyselWgg1cj/Wo9aObBrA0tntFBQ 6RV3ADmzHjvZS7e+SvN5hkcFQu2AYeiRJUAOEt5qSFyk+VQ+UN/STgIMnzBYarOqqarch6bVGaL vGOv7BArWNz4qCWRon+7duT88qjM3FA== X-Gm-Gg: ASbGncsjf6WorbqXScz2miHrKlVy6X9DI2AHj5bX33W+NJy8nbwFbnywgtZkPMo5brp IRjNNuKtQ/zj2vJ5V1sxt126S/qSpNDtJ6kKD6g== X-Google-Smtp-Source: AGHT+IEUvDM8WrZqpVwjvnotS/f5hsXkkjjrKSX6xFJGDRYJeoQHNCLh9feBxRQHZFHWO8BSL0alJdEKj6CJE75aDf0= X-Received: by 2002:a05:6000:144b:b0:386:3702:d2d8 with SMTP id ffacd0b85a97d-3863702d4e4mr8034148f8f.58.1733785254206; Mon, 09 Dec 2024 15:00:54 -0800 (PST) MIME-Version: 1.0 References: <8aa1d1d7-645f-404b-a8f8-7c49be9acd27@vondra.me> In-Reply-To: <8aa1d1d7-645f-404b-a8f8-7c49be9acd27@vondra.me> From: Michael Harris Date: Tue, 10 Dec 2024 10:00:43 +1100 Message-ID: Subject: Re: FileFallocate misbehaving on XFS To: Tomas Vondra Cc: PostgreSQL-development Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Tomas On Mon, 9 Dec 2024 at 21:06, Tomas Vondra wrote: > Sounds more like an XFS bug/behavior, so it's not clear to me what we > could do about it. I mean, if the filesystem reports bogus out-of-space, > is there even something we can do? I don't disagree that it's most likely an XFS issue. However, XFS is pretty widely used - it's the default FS for RHEL & the default in SUSE for non-root partitions - so maybe some action should be taken. Some things we could consider: - Providing a way to configure PG not to use posix_fallocate at runtime - Detecting the use of XFS (probably nasty and complex to do in a platform independent way) and disable posix_fallocate - In the case of posix_fallocate failing with ENOSPC, fall back to FileZero (worst case that will fail as well, in which case we will know that we really are out of space) - Documenting that XFS might not be a good choice, at least for some kernel versions > What is not clear to me is why would this affect pg_upgrade at all. We > have the data files split into 1GB segments, and the copy/clone/... goes > one by one. So there shouldn't be more than 1GB "extra" space needed. > Surely you have more free space on the system? Yes, that also confused me. It actually fails during the schema restore phase - where pg_upgrade calls pg_restore to restore a schema-only dump that it takes earlier in the process. At this stage it is only trying to restore the schema, not any actual table data. Note that we use the --link option to pg_upgrade, so it should not be using much space even when the table data is being upgraded. The filesystems have >1TB free space when this has occurred. It does continue to give this error after the upgrade, at apparently random intervals, when data is being loaded into the DB using COPY commands, so it might be best not to focus too much on the fact that we first encounter it during the upgrade. Cheers Mike.