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 1k2ifd-0001sN-Ry for pgsql-general@arkaria.postgresql.org; Mon, 03 Aug 2020 22:11:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1k2ifc-0001Xk-Pz for pgsql-general@arkaria.postgresql.org; Mon, 03 Aug 2020 22:11:00 +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 1k2ifc-0001Xd-GL for pgsql-general@lists.postgresql.org; Mon, 03 Aug 2020 22:11:00 +0000 Received: from anteater.elm.relay.mailchannels.net ([23.83.212.3]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k2ifZ-0007vi-6C for pgsql-general@postgresql.org; Mon, 03 Aug 2020 22:11:00 +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 6F0579210C8; Mon, 3 Aug 2020 22:10:53 +0000 (UTC) Received: from a2ss24.a2hosting.com (100-96-9-43.trex.outbound.svc.cluster.local [100.96.9.43]) (Authenticated sender: a2hosting) by relay.mailchannels.net (Postfix) with ESMTPA id 58FCC920D74; Mon, 3 Aug 2020 22:10:52 +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); Mon, 03 Aug 2020 22:10:53 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: a2hosting|x-authuser|bench@silentmedia.com X-MailChannels-Auth-Id: a2hosting X-Squirrel-Shelf: 59848f9132f40421_1596492653241_1704356814 X-MC-Loop-Signature: 1596492653241:3175251589 X-MC-Ingress-Time: 1596492653241 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=silentmedia.com; s=default; h=Content-Type:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:Subject:Sender:Reply-To: Content-Transfer-Encoding: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=TFy//9uI4eas8zg8/gde3tZAkKsygnwaxGAv7RKzQuA=; b=w5W88W34HxHyfGDZSKbO3ZLs2 jhe6xodvuhjP6uiZl26eWfCulXFzyM5kfC89O1X2ZtUveMEYl9fpellu9MclBOkCxCBM+ZpVkiHta rA2qDGsh3wODxHdKO7lBCmgoSWcELFAsRxvn9Npp3YFjR829VcEZ0xQns9HnRCZduOKdH1npENsNr +QTM4eCszerzdTEi6dTrxC6gq1w0bATF1N0KLbmIeOTEicwg93ThNpVMQ6ec788DupWlRtdQK4j5k ENtCdLqN3gceBBQOYfyfex1TA3oporgL/AB7LaSoaNpm7VC/RXaltQmjEe83XdSLWNZoVHRJNQldi U+liWeN+Q==; Received: from 174-21-131-86.tukw.qwest.net ([174.21.131.86]:54609 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 1k2ifT-005Vv2-9f; Mon, 03 Aug 2020 18:10:51 -0400 Subject: Re: 12.3 replicas falling over during WAL redo To: Peter Geoghegan Cc: Alvaro Herrera , pgsql-general References: <20200803213454.GA32739@alvherre.pgsql> From: Ben Chobot Message-ID: <8cb30a3b-72a6-512a-7ce4-dce671c76379@silentmedia.com> Date: Mon, 3 Aug 2020 15:10:49 -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: Content-Type: multipart/alternative; boundary="------------C36573EA4901A0F83C2AC527" Content-Language: en-US X-AuthUser: bench@silentmedia.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------C36573EA4901A0F83C2AC527 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Peter Geoghegan wrote on 8/3/20 3:04 PM: > On Mon, Aug 3, 2020 at 2:35 PM Alvaro Herrera wrote: >> You can use pageinspect's page_header() function to obtain the page's >> LSN. You can use dd to obtain the page from the file, >> >> dd if=16605/16613/60529051 bs=8192 count=1 seek=6501 of=/tmp/page.6501 > Ben might find this approach to dumping out a single page image > easier, since it doesn't involve relfilenodes or filesystem files: > > https://wiki.postgresql.org/wiki/Getting_a_stack_trace_of_a_running_PostgreSQL_backend_on_Linux/BSD#contrib.2Fpageinspect_page_dump I don't think that works, because it sounds like this requires I connect to the db, but that means I have to start it up. I am (wrongly?) assuming we should get what we can while the db is still in a just-crashed state. Still, I seem to have mangled Alvaro's suggestion somehow, because this doesn't look right: # select h.* from public.page , page_header(raw) h;  lsn | checksum | flags | lower | upper | special | pagesize | version | prune_xid -----+----------+-------+-------+-------+---------+----------+---------+-----------  0/0 |        0 |     0 |     0 |     0 |       0 |        0 |       0 |         0 (1 row) I'll keep trying though. --------------C36573EA4901A0F83C2AC527 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit Peter Geoghegan wrote on 8/3/20 3:04 PM:
On Mon, Aug 3, 2020 at 2:35 PM Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
You can use pageinspect's page_header() function to obtain the page's
LSN.  You can use dd to obtain the page from the file,

dd if=16605/16613/60529051 bs=8192 count=1 seek=6501 of=/tmp/page.6501
Ben might find this approach to dumping out a single page image
easier, since it doesn't involve relfilenodes or filesystem files:

https://wiki.postgresql.org/wiki/Getting_a_stack_trace_of_a_running_PostgreSQL_backend_on_Linux/BSD#contrib.2Fpageinspect_page_dump

I don't think that works, because it sounds like this requires I connect to the db, but that means I have to start it up. I am (wrongly?) assuming we should get what we can while the db is still in a just-crashed state.

Still, I seem to have mangled Alvaro's suggestion somehow, because this doesn't look right:

# select h.* from public.page , page_header(raw) h;
 lsn | checksum | flags | lower | upper | special | pagesize | version | prune_xid
-----+----------+-------+-------+-------+---------+----------+---------+-----------
 0/0 |        0 |     0 |     0 |     0 |       0 |        0 |       0 |         0
(1 row)

I'll keep trying though.
--------------C36573EA4901A0F83C2AC527--