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 1pqyam-00006N-3Z for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Apr 2023 15:59:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pqyak-0003vt-VA for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Apr 2023 15:59:02 +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 1pqyak-0003vk-Lb for pgsql-hackers@lists.postgresql.org; Mon, 24 Apr 2023 15:59:02 +0000 Received: from mail-qk1-x72b.google.com ([2607:f8b0:4864:20::72b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1pqyah-004p98-M5 for pgsql-hackers@lists.postgresql.org; Mon, 24 Apr 2023 15:59:01 +0000 Received: by mail-qk1-x72b.google.com with SMTP id af79cd13be357-74ab718c344so1302768885a.1 for ; Mon, 24 Apr 2023 08:58:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682351937; x=1684943937; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:from:to:cc :subject:date:message-id:reply-to; bh=9kk9S+3gnyZwslWnr8HfLV76BIWgLANOMuIcx2Kq4RA=; b=FSjrVcJb6cZ5Wr1AbLzh18FlLy8IVueps7fbriUPmjvA5LuX3TjXYbYCzdccHmYNww +yeA0Y4ZjG5ASuz8zaZkfSaaJhA35+a0jdp1mwSxxQlVLGV+7N/sXYvlTQMvK0cNOJal sGH+9hl7JI+0uMao5c3iXXWGUIemW92BKskLn5s7nazLaCUSkSn5ahiP1G+r0P/SfWV8 ArwYQgVpyAjwTeQNG/1MpQeFhk4b0PysGfTpx/70HXSZrStHd9kPxezuaItx4YQQu9xq 12iU073mWLz6N36LC3LgJqqspjZQ215mnQQMOWq0EzuYDC1YZccBaZD+1dCKHUiwnOCk Dh0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682351937; x=1684943937; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9kk9S+3gnyZwslWnr8HfLV76BIWgLANOMuIcx2Kq4RA=; b=lI7NrQlqU859Sdx7d8n0qGYeTcO7xHjV7aAuf1NA7/9zpU0LkSTSfZXljEv9f5VM75 cjs59envjX2HdvkLgL7j5NgAWFaFk0rTx2Zx/D3K7cyJbQ4Nzz1ioq++UHIueeSSsoY+ WgkpbnRQDi4RgMNQSo6Zi6BvboKXNasc1eNUnq9HWvLbtvgLCy9bCXlCuDMHa7QhLqUT FeeLXWETCJHwdMxQeAy8O65GaRY2RlqbZ6VqVgkJNra2aQS+1dQSVOTMlwPkHFmbukpx IFcqcl/RP4XfRJnYD5L5rzokh3CUeMyJduuEZcIY0rFmAidpuR5hzqaeAdZlErQbJTcm IG/w== X-Gm-Message-State: AAQBX9caFCultEPIIj2MyeHu4epZlEGN9e0ITsuT+eNim9BWmVA6C5Ek 0a3icosclladfjg4ObbVUxjNHcvrAZQ= X-Google-Smtp-Source: AKy350YEr9Z41/iO4WyOP9D+B3VpqNpxUE8Rzc0+RjcB6Hrk4gMeAEZJljjodFm69SxivS8npIV7KA== X-Received: by 2002:a05:6214:20ab:b0:5dd:b986:b44 with SMTP id 11-20020a05621420ab00b005ddb9860b44mr26995620qvd.6.1682351937404; Mon, 24 Apr 2023 08:58:57 -0700 (PDT) Received: from liskov ([2600:4040:7eef:cc01:d0c0:26f1:a014:456b]) by smtp.gmail.com with ESMTPSA id q2-20020a37f702000000b0074acdb873a7sm3633306qkj.86.2023.04.24.08.58.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Apr 2023 08:58:56 -0700 (PDT) Date: Mon, 24 Apr 2023 11:58:55 -0400 From: Melanie Plageman To: Christoph Berg Cc: Andres Freund , pgsql-hackers@lists.postgresql.org Subject: Re: could not extend file "base/5/3501" with FileFallocate(): Interrupted system call Message-ID: <20230424155855.roatu3odubmue4i2@liskov> Mail-Followup-To: Christoph Berg , Andres Freund , pgsql-hackers@lists.postgresql.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Apr 24, 2023 at 10:53:35AM +0200, Christoph Berg wrote: > Re: Andres Freund > > Add smgrzeroextend(), FileZero(), FileFallocate() > > Hi, > > I'm often seeing PG16 builds erroring out in the pgbench tests: > > 00:33:12 make[2]: Entering directory '/<>/build/src/bin/pgbench' > 00:33:12 echo "# +++ tap check in src/bin/pgbench +++" && rm -rf '/<>/build/src/bin/pgbench'/tmp_check && /bin/mkdir -p '/<>/build/src/bin/pgbench'/tmp_check && cd /<>/build/../src/bin/pgbench && TESTLOGDIR='/<>/build/src/bin/pgbench/tmp_check/log' TESTDATADIR='/<>/build/src/bin/pgbench/tmp_check' PATH="/<>/build/tmp_install/usr/lib/postgresql/16/bin:/<>/build/src/bin/pgbench:$PATH" LD_LIBRARY_PATH="/<>/build/tmp_install/usr/lib/aarch64-linux-gnu" PGPORT='65432' top_builddir='/<>/build/src/bin/pgbench/../../..' PG_REGRESS='/<>/build/src/bin/pgbench/../../../src/test/regress/pg_regress' /usr/bin/prove -I /<>/build/../src/test/perl/ -I /<>/build/../src/bin/pgbench --verbose t/*.pl > 00:33:12 # +++ tap check in src/bin/pgbench +++ > 00:33:14 # Failed test 'concurrent OID generation status (got 2 vs expected 0)' > 00:33:14 # at t/001_pgbench_with_server.pl line 31. > 00:33:14 # Failed test 'concurrent OID generation stdout /(?^:processed: 125/125)/' > 00:33:14 # at t/001_pgbench_with_server.pl line 31. > 00:33:14 # 'pgbench (16devel (Debian 16~~devel-1.pgdg100+~20230423.1656.g8bbd0cc)) > 00:33:14 # transaction type: /<>/build/src/bin/pgbench/tmp_check/t_001_pgbench_with_server_main_data/001_pgbench_concurrent_insert > 00:33:14 # scaling factor: 1 > 00:33:14 # query mode: prepared > 00:33:14 # number of clients: 5 > 00:33:14 # number of threads: 1 > 00:33:14 # maximum number of tries: 1 > 00:33:14 # number of transactions per client: 25 > 00:33:14 # number of transactions actually processed: 118/125 > 00:33:14 # number of failed transactions: 0 (0.000%) > 00:33:14 # latency average = 26.470 ms > 00:33:14 # initial connection time = 66.583 ms > 00:33:14 # tps = 188.889760 (without initial connection time) > 00:33:14 # ' > 00:33:14 # doesn't match '(?^:processed: 125/125)' > 00:33:14 # Failed test 'concurrent OID generation stderr /(?^:^$)/' > 00:33:14 # at t/001_pgbench_with_server.pl line 31. > 00:33:14 # 'pgbench: error: client 2 script 0 aborted in command 0 query 0: ERROR: could not extend file "base/5/3501" with FileFallocate(): Interrupted system call > 00:33:14 # HINT: Check free disk space. > 00:33:14 # pgbench: error: Run was aborted; the above results are incomplete. > 00:33:14 # ' > 00:33:14 # doesn't match '(?^:^$)' > 00:33:26 # Looks like you failed 3 tests of 428. > 00:33:26 t/001_pgbench_with_server.pl .. > 00:33:26 not ok 1 - concurrent OID generation status (got 2 vs expected 0) > > I don't think the disk is full since it's always hitting that same > spot, on some of the builds: > > https://pgdgbuild.dus.dg-i.net/job/postgresql-16-binaries-snapshot/833/ > > This is overlayfs with tmpfs (upper)/ext4 (lower). Manually running > that test works though, and the FS seems to support posix_fallocate: > > #include > #include > > int main () > { > int f; > int err; > > if (!(f = open("moo", O_CREAT | O_RDWR, 0666))) > perror("open"); > > err = posix_fallocate(f, 0, 10); > perror("posix_fallocate"); > > return 0; > } > > $ ./a.out > posix_fallocate: Success > > The problem has been there for some weeks - I didn't report it earlier > as I was on vacation, in the free time trying to bootstrap s390x > support for apt.pg.o, and there was this other direct IO problem > making all the builds fail for some time. I noticed that dsm_impl_posix_resize() does a do while rc==EINTR and FileFallocate() doesn't. From what the comment says in dsm_impl_posix_resize() and some cursory googling, posix_fallocate() doesn't restart automatically on most systems, so a do while() rc==EINTR is often used. Is there a reason it isn't used in FileFallocate() I wonder? - Melanie