Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iX298-0005bW-ES for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Nov 2019 11:58:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iX296-00009W-N1 for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Nov 2019 11:58:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iX296-00009I-A3 for pgsql-hackers@lists.postgresql.org; Tue, 19 Nov 2019 11:58:12 +0000 Received: from mail-yb1-xb2f.google.com ([2607:f8b0:4864:20::b2f]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iX28y-0002LT-Rn for pgsql-hackers@postgresql.org; Tue, 19 Nov 2019 11:58:11 +0000 Received: by mail-yb1-xb2f.google.com with SMTP id y18so8637276ybs.7 for ; Tue, 19 Nov 2019 03:58:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:user-agent; bh=55dCl0B4JUBMco5NE7kbxH56Y9p+3cXx7sm0SWhdfY4=; b=BVKu0MmIAG1Jl2y81xnGppHwiXNk+S0jps9/jmztgs73yAVaD2hoAwn2Yk50cAwuaw fZ5A9QSew4ZOyKQvp86meGfWeGFtEueCxDV/B9pAOiZuQ0I1XZzggM5u2qGDA5vKOxxE fKlgqF8NGNiTBhw9rhyTI61Lx6gmDBbenYxZEPt3fSHjE/LvUJk0JmLPcew45arThrhl cB/6nqQhH+EJmL7SVdUCNKf2ea+HAMRiS1ZePb//jxzFmTtGV0Q4vLJwQzCO0a9EFUXj jy2IkaK8ia08xSrtHcU21Go9TkH485IOa2oVB8gj0v0Zb60pl1Y+8DdKaPA6LKtnyAfD pxtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:user-agent; bh=55dCl0B4JUBMco5NE7kbxH56Y9p+3cXx7sm0SWhdfY4=; b=I/ZAnJl83N2rO6yEpfIyXs/zEkPlgAkE2Xx4QB5fvQAf+PEGg1gZ7b7w6w2uZsO/TN zXmzc3N1Qy8ugHfmBumJb3fQsC7VH+l3xJZnb4OTKa5gcBZ+kn9KYpcM3QLE4b65M7VJ I0YFizi/oDhjdFa9kaieey1ZEWSP9b8bQeHCNpoAjJAsPTGDXAWiQZ3by3YfPVpFE3Mw +7aQC0OGWXCynJlK6XpIt7+Qnu0DPgmnvPUdQq7i1WCjFOg0WxiBu80e00Xr+w2FPgY0 fzi5s9xYtJN7Sez50mV9ghb31mbs03xMbnFCgytCchxaaQIimbTlJ+tVc/WUOmarIkGp zRKw== X-Gm-Message-State: APjAAAUGsih2az0fh6PDFR4xla+vC2oNNHjU4N3ylRzc1jHfwRJXqi1p uqEMZXWgsF+jr6Pk+Vn/XeOMxl3h9hI= X-Google-Smtp-Source: APXvYqxFnrFbuSPyM4QfdKRxE6IFuyOj7HlSmUm9DeOuOdrupmVr8joak8Q64Rjdan4/z5IqTDVgBg== X-Received: by 2002:a25:bdd0:: with SMTP id g16mr27057066ybk.319.1574164682441; Tue, 19 Nov 2019 03:58:02 -0800 (PST) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id l68sm9386329ywf.89.2019.11.19.03.58.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Nov 2019 03:58:01 -0800 (PST) Received: by pryzbyj (Postfix, from userid 1000) id E4BE2800AB8; Tue, 19 Nov 2019 05:57:59 -0600 (CST) Date: Tue, 19 Nov 2019 05:57:59 -0600 From: Justin Pryzby To: pgsql-hackers@postgresql.org Cc: Thomas Munro Subject: checkpointer: PANIC: could not fsync file: No such file or directory Message-ID: <20191119115759.GI30362@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I (finally) noticed this morning on a server running PG12.1: < 2019-11-15 22:16:07.098 EST >PANIC: could not fsync file "base/16491/1731839470.2": No such file or directory < 2019-11-15 22:16:08.751 EST >LOG: checkpointer process (PID 27388) was terminated by signal 6: Aborted /dev/vdb on /var/lib/pgsql type ext4 (rw,relatime,seclabel,data=ordered) Centos 7.7 qemu/KVM Linux database 3.10.0-1062.1.1.el7.x86_64 #1 SMP Fri Sep 13 22:55:44 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux There's no added tablespaces. Copying Thomas since I wonder if this is related: 3eb77eba Refactor the fsync queue for wider use. I can't find any relation with filenode nor OID matching 1731839470, nor a file named like that (which is maybe no surprise, since it's exactly the issue checkpointer had last week). A backup job would've started at 22:00 and probably would've run until 22:27, except that its backend was interrupted "because of crash of another server process". That uses pg_dump --snapshot. This shows a gap of OIDs between 1721850297 and 1746136569; the tablenames indicate that would've been between 2019-11-15 01:30:03,192 and 04:31:19,348. |SELECT oid, relname FROM pg_class ORDER BY 1 DESC; Ah, I found a maybe relevant log: |2019-11-15 22:15:59.592-05 | duration: 220283.831 ms statement: ALTER TABLE child.eric_enodeb_cell_201811 ALTER pmradiothpvolul So we altered that table (and 100+ others) with a type-promoting alter, starting at 2019-11-15 21:20:51,942. That involves DETACHing all but the most recent partitions, altering the parent, and then iterating over historic children to ALTER and reATTACHing them. (We do this to avoid locking the table for long periods, and to avoid worst-case disk usage). FYI, that server ran PG12.0 since Oct 7 with no issue. I installed pg12.1 at: $ ps -O lstart 27384 PID STARTED S TTY TIME COMMAND 27384 Fri Nov 15 08:13:08 2019 S ? 00:05:54 /usr/pgsql-12/bin/postmaster -D /var/lib/pgsql/12/data/ Core was generated by `postgres: checkpointer '. Program terminated with signal 6, Aborted. (gdb) bt #0 0x00007efc9d8b3337 in raise () from /lib64/libc.so.6 #1 0x00007efc9d8b4a28 in abort () from /lib64/libc.so.6 #2 0x000000000087752a in errfinish (dummy=) at elog.c:552 #3 0x000000000075c8ec in ProcessSyncRequests () at sync.c:398 #4 0x0000000000734dd9 in CheckPointBuffers (flags=flags@entry=256) at bufmgr.c:2588 #5 0x00000000005095e1 in CheckPointGuts (checkPointRedo=26082542473320, flags=flags@entry=256) at xlog.c:9006 #6 0x000000000050ff86 in CreateCheckPoint (flags=flags@entry=256) at xlog.c:8795 #7 0x00000000006e4092 in CheckpointerMain () at checkpointer.c:481 #8 0x000000000051fcd5 in AuxiliaryProcessMain (argc=argc@entry=2, argv=argv@entry=0x7ffda8a24340) at bootstrap.c:461 #9 0x00000000006ee680 in StartChildProcess (type=CheckpointerProcess) at postmaster.c:5392 #10 0x00000000006ef9ca in reaper (postgres_signal_arg=) at postmaster.c:2973 #11 #12 0x00007efc9d972933 in __select_nocancel () from /lib64/libc.so.6 #13 0x00000000004833d4 in ServerLoop () at postmaster.c:1668 #14 0x00000000006f106f in PostmasterMain (argc=argc@entry=3, argv=argv@entry=0x1601280) at postmaster.c:1377 #15 0x0000000000484cd3 in main (argc=3, argv=0x1601280) at main.c:228 bt f: #3 0x000000000075c8ec in ProcessSyncRequests () at sync.c:398 path = "base/16491/1731839470.2\000m\000e\001\000\000\000\000hЭи\027\000\000\032\364q\000\000\000\000\000\251\202\214\000\000\000\000\000\004\000\000\000\000\000\000\000\251\202\214\000\000\000\000\000@S`\001\000\000\000\000\000>\242\250\375\177\000\000\002\000\000\000\000\000\000\000\340\211b\001\000\000\000\000\002\346\241\000\000\000\000\000\200>\242\250\375\177\000\000\225ኝ\374~\000\000C\000_US.UTF-8\000\374~\000\000\000\000\000\000\000\000\000\000\306ފ\235\374~\000\000LC_MESSAGES/postgres-12.mo\000\000\000\000\000\000\001\000\000\000\000\000\000\000.ފ\235\374~"... failures = 1 sync_in_progress = true hstat = {hashp = 0x1629e00, curBucket = 122, curEntry = 0x0} entry = 0x1658590 absorb_counter = processed = 43