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 1fQMQt-0006U3-A0 for pgsql-general@arkaria.postgresql.org; Wed, 06 Jun 2018 00:36:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fQMQp-00016f-3T for pgsql-general@arkaria.postgresql.org; Wed, 06 Jun 2018 00:36:07 +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 1fQMQo-00016W-MX for pgsql-general@lists.postgresql.org; Wed, 06 Jun 2018 00:36:06 +0000 Received: from mail-qk0-x22b.google.com ([2607:f8b0:400d:c09::22b]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fQMQm-0004nO-3O for pgsql-general@lists.postgresql.org; Wed, 06 Jun 2018 00:36:05 +0000 Received: by mail-qk0-x22b.google.com with SMTP id q70-v6so2884387qke.1 for ; Tue, 05 Jun 2018 17:36:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=m6eB6dZCUyJFAFiaVGv+RlghaQ05j5bhzViycDugAns=; b=RUpI0GFjv7mlvq/pgZpu5LbIhKvBlG0s57O4122HySFQHv+2aZhfgzzj72CGgHNHLl 4TDrStfs2OWEsam83MaqdQf+20zMo9xqE7AZD61qKdGLBqczCOFsqr1dGl8Rn9hVOT1+ SZB2ih8omRCBLl68mVmu0IzXr6T1yoGTm6agqA6eXA+N5CvGeEo6DU1D68Kq9Z/XxCBH wsoc8XirPrYaMvVxlieSaSrUaompHQS54VHaKZ7LWyYGU2gfUBFLPOPXY/3pNImhhDl7 b+xCTkBMvXcHY/3MfozwS4G1UYIgk88PgJVvxSsaHi2UfLkrhKBIXVm6RQKlSZvCh6sf EKBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=m6eB6dZCUyJFAFiaVGv+RlghaQ05j5bhzViycDugAns=; b=pFpVHBTDoF168Fh8KJ39c1TzZwvQPqMsKDqjvW8cU91LXBd+LNZSoiRGjDqc6Ml35q xhTWc94QVBhj2y8XyoFqI8X/HfyxlLt9g+XyfTkCj8LJG04ExqYooJ3l/t+WR4DV+Kw5 HEafk4UP34jENWt7M/L0bKTgHzkaBjXn7H32a8yrBYFE4QgChc5JLS4c+k2xd5Us1LRn skTXEJTUQaR1SGSIYCVBH9ziwCqRSgIYwaIJQ3nTq/GDRXT2isnGBdTF4vY2Zat64aZk chxvwVlqat/6qi+visXT72v7MezvYr2FgmE8nnIlMWHGKJ2WX3IPuHGwGz2Y9eUe+b8y F6tA== X-Gm-Message-State: APt69E2IREbRz4XO5o8KO0Z+H/p3xTBI/N+ZO1wHyHcBAdwQloxd4Xw7 G1fquf/cjk6Gr3bnbivfLlo= X-Google-Smtp-Source: ADUXVKL+5EX5TtSrdal7Jq01+9H/EcaBOKUclZStKT5QgwKGjp6iSt9Tpl8WBSiq8FHVdFLbbmaVzA== X-Received: by 2002:a37:dd49:: with SMTP id n70-v6mr742195qki.387.1528245363023; Tue, 05 Jun 2018 17:36:03 -0700 (PDT) Received: from [192.168.1.104] (50-249-28-57-static.hfc.comcastbusiness.net. [50.249.28.57]) by smtp.gmail.com with ESMTPSA id b2-v6sm24172322qkb.34.2018.06.05.17.36.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Jun 2018 17:36:02 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Subject: Re: Segfault leading to crash, recovery mode, and TOAST corruption From: Jonathan Marks In-Reply-To: <25981.1528243651@sss.pgh.pa.us> Date: Tue, 5 Jun 2018 20:36:00 -0400 Cc: pgsql-general@lists.postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <1CC7D7DB-7DD8-4451-97AB-03ED7CFDF10C@gmail.com> <25981.1528243651@sss.pgh.pa.us> To: Tom Lane X-Mailer: Apple Mail (2.3445.5.20) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Thank you so very much, Tom. Vacuuming fixed the TOAST corruption issue and we=E2=80=99ll upgrade our = instances tonight (max RDS has is 10.3, but that=E2=80=99s a start). > On Jun 5, 2018, at 8:07 PM, Tom Lane wrote: >=20 > 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. >=20 > I'd suggest updating to 10.4 ... see below. >=20 >> 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]:ERROR: 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 >=20 > 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 = there. >=20 >> 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]:ERROR: unexpected chunk = number 0 (expected 1) for toast value 1592283014 in pg_toast_26656 >=20 > 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. >=20 > regards, tom lane