Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fQM0w-0004gi-Gh for pgsql-general@arkaria.postgresql.org; Wed, 06 Jun 2018 00:09:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fQM0v-000216-99 for pgsql-general@arkaria.postgresql.org; Wed, 06 Jun 2018 00:09:21 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fQLzD-0003RQ-R7 for pgsql-general@lists.postgresql.org; Wed, 06 Jun 2018 00:07:35 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fQLzA-00049E-Tk for pgsql-general@lists.postgresql.org; Wed, 06 Jun 2018 00:07:34 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w5607VcT025982; Tue, 5 Jun 2018 20:07:31 -0400 From: Tom Lane To: Jonathan Marks cc: pgsql-general@lists.postgresql.org Subject: Re: Segfault leading to crash, recovery mode, and TOAST corruption In-reply-to: <1CC7D7DB-7DD8-4451-97AB-03ED7CFDF10C@gmail.com> References: <1CC7D7DB-7DD8-4451-97AB-03ED7CFDF10C@gmail.com> Comments: In-reply-to Jonathan Marks message dated "Tue, 05 Jun 2018 19:35:42 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <25980.1528243651.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 05 Jun 2018 20:07:31 -0400 Message-ID: <25981.1528243651@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Jonathan Marks writes: > We had two issues today (once this morning and once a few minutes ago) > with our primary database (RDS running 10.1, 32 cores, 240 GB RAM, 5TB > total disk space, 20k PIOPS) where the database suddenly crashed and > went into recovery mode. I'd suggest updating to 10.4 ... see below. > Both times that the server crashed, we saw this in the logs: > 2018-06-05 23:08:44 UTC:172.31.7.89(36224):production@OURDB:[12173]:ERRO= R: canceling statement due to statement timeout > 2018-06-05 23:08:44 UTC::@:[48863]:LOG: worker process: parallel worker= for PID 12173 (PID 20238) exited with exit code 1 > 2018-06-05 23:08:49 UTC::@:[48863]:LOG: server process (PID 12173) was = terminated by signal 11: Segmentation fault This looks to be a parallel leader process getting confused when a worker process exits unexpectedly. There were some related fixes in 10.2, which might resolve the issue, though it's also possible we have more to do ther= e. > After the first crash, we then started getting errors like: > 2018-06-05 23:08:45 UTC:172.31.6.84(33392):production@OURDB:[11888]:ERRO= R: unexpected chunk number 0 (expected 1) for toast value 1592283014 in p= g_toast_26656 This definitely looks to be the "reuse of TOAST OIDs immediately after crash" issue that was fixed in 10.4. AFAIK it's recoverable corruption; I believe you'll find that VACUUMing the parent table will make the errors stop, and all will be well. But an update would be prudent to prevent it from happening again. regards, tom lane