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 1k1upw-00075x-6B for pgsql-general@arkaria.postgresql.org; Sat, 01 Aug 2020 16:58:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1k1upu-0002HH-Rx for pgsql-general@arkaria.postgresql.org; Sat, 01 Aug 2020 16:58:18 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k1upu-0002HA-H9 for pgsql-general@lists.postgresql.org; Sat, 01 Aug 2020 16:58:18 +0000 Received: from egyptian.birch.relay.mailchannels.net ([23.83.209.56]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k1upn-00017l-Au for pgsql-general@postgresql.org; Sat, 01 Aug 2020 16:58:17 +0000 X-Sender-Id: a2hosting|x-authuser|bench@silentmedia.com Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id EA4B112155A; Sat, 1 Aug 2020 16:58:08 +0000 (UTC) Received: from a2ss24.a2hosting.com (100-96-8-55.trex.outbound.svc.cluster.local [100.96.8.55]) (Authenticated sender: a2hosting) by relay.mailchannels.net (Postfix) with ESMTPA id 55CA4121540; Sat, 1 Aug 2020 16:58:08 +0000 (UTC) X-Sender-Id: a2hosting|x-authuser|bench@silentmedia.com Received: from a2ss24.a2hosting.com (a2ss24.a2hosting.com [75.98.175.117]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.18.8); Sat, 01 Aug 2020 16:58:08 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: a2hosting|x-authuser|bench@silentmedia.com X-MailChannels-Auth-Id: a2hosting X-Minister-Belong: 108c622120644fd2_1596301088775_2665186538 X-MC-Loop-Signature: 1596301088774:158380978 X-MC-Ingress-Time: 1596301088774 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=silentmedia.com; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Gl2Ay+EioRhUB+JvycpIal5GanCOeEsBmMWKxfaEz4k=; b=ycvlXipHdQz8j7lKrbQ9gFxWpd Y3RGf+6Ja6PurMQ/Jegkx4py05RvQ6i7qjqqArQtChykzbs6ldjnShHL51nAb8inANM3kWjW+ImgL 6Wmer0NGvHABUIuO9xfTHpmt7jUp6anP6OS9YkvQJmAZLWZaR7M1EUK+Ku2fJKSnbuSYA7qcVfoca KkZJSnvt2L0++2kugHXw0Em0wvS0I/l+cIP3NklPqVM0XM9gFs080BjvNzy37w17QEhnvWJcPItyU EdWtdoMEhq3RhAZDi89hKIu2HvGoFR4koEg9ojLUIhttRjD5K6sdRkfMoh9Tyg2ukrJM/9Tvk55nG y6YgbDqQ==; Received: from 174-21-131-86.tukw.qwest.net ([174.21.131.86]:51722 helo=Rolo.local) by a2ss24.a2hosting.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1k1upj-008GDQ-2R; Sat, 01 Aug 2020 12:58:07 -0400 Subject: Re: 12.3 replicas falling over during WAL redo To: Alvaro Herrera Cc: pgsql-general References: <20200801163551.GA12860@alvherre.pgsql> From: Ben Chobot Message-ID: Date: Sat, 1 Aug 2020 09:58:05 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:52.0) Gecko/20100101 PostboxApp/7.0.25 MIME-Version: 1.0 In-Reply-To: <20200801163551.GA12860@alvherre.pgsql> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-AuthUser: bench@silentmedia.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Alvaro Herrera wrote on 8/1/20 9:35 AM: > On 2020-Aug-01, Ben Chobot wrote: > >> We have a few hundred postgres servers in AWS EC2, all of which do streaming >> replication to at least two replicas. As we've transitioned our fleet to >> from 9.5 to 12.3, we've noticed an alarming increase in the frequency of a >> streaming replica dying during replay. Postgres will log something like: >> >> |2020-07-31T16:55:22.602488+00:00 hostA postgres[31875]: [19137-1] db=,user= >> LOG: restartpoint starting: time 2020-07-31T16:55:24.637150+00:00 hostA >> postgres[24076]: [15754-1] db=,user= FATAL: incorrect index offsets supplied >> 2020-07-31T16:55:24.637261+00:00 hostA postgres[24076]: [15754-2] db=,user= >> CONTEXT: WAL redo at BCC/CB7AF8B0 for Btree/VACUUM: lastBlockVacuumed 1720 >> 2020-07-31T16:55:24.642877+00:00 hostA postgres[24074]: [8-1] db=,user= LOG: >> startup process (PID 24076) exited with exit code 1| > I've never seen this one. > > Can you find out what the index is being modified by those LSNs -- is it > always the same index? Can you have a look at nearby WAL records that > touch the same page of the same index in each case? > > One possibility is that the storage forgot a previous write. I'd be happy to, if you tell me how. :) We're using xfs for our postgres filesystem, on ubuntu bionic. Of course it's always possible there's something wrong in the filesystem or the EBS layer, but that is one thing we have not changed in the migration from 9.5 to 12.3.