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 1kPcrj-0005tl-8s for pgsql-committers@arkaria.postgresql.org; Tue, 06 Oct 2020 02:38:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kPcri-0006ON-4O for pgsql-committers@arkaria.postgresql.org; Tue, 06 Oct 2020 02:38:10 +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 1kPcrh-0006OG-VW for pgsql-committers@lists.postgresql.org; Tue, 06 Oct 2020 02:38:09 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kPcrf-0002gq-AZ for pgsql-committers@lists.postgresql.org; Tue, 06 Oct 2020 02:38:09 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 8EBB15C0062; Mon, 5 Oct 2020 22:38:04 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Mon, 05 Oct 2020 22:38:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=SEAT5/3OMlmgXCoSL9xgk93lZBX QHq/6rC/6qZvq5CQ=; b=I/zfuxVh2vw11/5El3QfzktaNbTMXTugWk0tjdvYUe9 FzVLBQ/MXlL2dmFMhtrUi7Jmlwz3ePxyUFeD5w68azwfLN8LEFoynEIKFO8GPXa6 AZ+BWVbSA2T90E3jWqS2dfavBewzT/hMbGy+dRBcYpyfwC4LzFUCLkVuZ+LLQoji SRZrwlHfXRrmnAi0hX7NofflueLYao6bHrnaZdLPfTKa3guf2QhRKdtv/pK2KChK bV0P0SdLW7Due+DeI31jq2fjNj8JhEZ4ENNCpAxG3aiq3h/INtnXyPlWI3Tjzgoh 2zYAZEiBtyV6aFhykk6vJRsZnGj334hU/NmWV9CLSSQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=SEAT5/ 3OMlmgXCoSL9xgk93lZBXQHq/6rC/6qZvq5CQ=; b=mUdurklixkGNXjR6t9A3Tt VUxau3tT2mhmbdOqadpL5Z63OhouJlUWbtJ+pIJfCnQsBg8RphvRmTcJpAkXV838 uqp7C09zIhy5Dk2SmfA9C5avAtpB6HZF2X/pGX+9x5sMK5HoTUxvNoBzHlScS443 BPJXQ0uTEi9cgJsRlffEeA05IY5Ofc/2SpJiWBxa1gGIDklXi/+u1+0X04z40GOP JzXeZUBGyX2PE0b76CMjcGogpbqy0KR2Vsu3RA/fBsXDry1SZdjrFTdLBuuPS5ad bVnhsfY06e+PiC6THhc+ix7LP48Ttos7p2LUANcbOETsAb6uD/yHdYSqZV33+IDg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrgeefgdeiudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomheptehnughrvghs ucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrfgrth htvghrnhepffdvvdevleelgffhheeitdevhfefgfeivdevieeltdffkeefgffguedtkeei heejnecuffhomhgrihhnpehpohhsthhgrhdrvghsnecukfhppeeijedrudeitddrvdduje drvdehtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhm pegrnhgurhgvshesrghnrghrrgiivghlrdguvg X-ME-Proxy: Received: from intern.anarazel.de (c-67-160-217-250.hsd1.ca.comcast.net [67.160.217.250]) by mail.messagingengine.com (Postfix) with ESMTPA id CC351306467D; Mon, 5 Oct 2020 22:38:03 -0400 (EDT) Date: Mon, 5 Oct 2020 19:38:02 -0700 From: Andres Freund To: Michael Paquier Cc: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Add block information in error context of WAL REDO apply loop Message-ID: <20201006023802.qqfi6m5bw5y77zql@alap3.anarazel.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On 2020-10-02 00:41:12 +0000, Michael Paquier wrote: > Add block information in error context of WAL REDO apply loop > > Providing this information can be useful for example when diagnosing > problems related to recovery conflicts or for recovery issues without > having to go through the output generated by pg_waldump to get some > information about the blocks a WAL record works on. > > The block information is printed in the same format as pg_waldump. This > already existed in xlog.c for debugging purposes with -DWAL_DEBUG, so > adding the block information in the callback has required just a small > refactoring. > > Author: Bertrand Drouvot > Reviewed-by: Michael Paquier, Masahiko Sawada > Discussion: https://postgr.es/m/c31e2cba-efda-762c-f4ad-5c25e5dac3d0@amazon.com My compiler quite justifiably complains about: +#endif /* WAL_DEBUG */ + +/* + * Returns a string giving information about all the blocks in an + * XLogRecord. + */ +static void +xlog_block_info(StringInfo buf, XLogReaderState *record) +{ + int block_id; + /* decode block references */ for (block_id = 0; block_id <= record->max_block_id; block_id++) { @@ -10284,7 +10298,6 @@ xlog_outrec(StringInfo buf, XLogReaderState *record) appendStringInfoString(buf, " FPW"); } } -#endif /* WAL_DEBUG */ because as far as I can see there's no remaining use of block_id in xlog_outrec() after this change. Greetings, Andres Freund