pg.ddx.io pgsql-committers@postgresql.org mailing list archive
help / color / mirror / Atom feedpgsql: Add block information in error context of WAL REDO apply loop
3+ messages / 2 participants
[nested] [flat]
Commits from this thread:
2020-10-06 0a3c864c32 Fix compilation warning in xlog.c
* pgsql: Add block information in error context of WAL REDO apply loop
@ 2020-10-02 00:41 Michael Paquier <michael@paquier.xyz>
0 siblings, 1 reply; 3+ messages in thread
From: Michael Paquier @ 2020-10-02 00:41 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
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
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/9d0bd95fa90a7243047a74e29f265296a9fc556d
Modified Files
--------------
src/backend/access/transam/xlog.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: pgsql: Add block information in error context of WAL REDO apply loop
@ 2020-10-06 02:38 Andres Freund <andres@anarazel.de>
parent: Michael Paquier <michael@paquier.xyz>
0 siblings, 1 reply; 3+ messages in thread
From: Andres Freund @ 2020-10-06 02:38 UTC (permalink / raw)
To: Michael Paquier <michael@paquier.xyz>; +Cc: pgsql-committers@lists.postgresql.org
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
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: pgsql: Add block information in error context of WAL REDO apply loop
@ 2020-10-06 06:35 Michael Paquier <michael@paquier.xyz>
parent: Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 3+ messages in thread
From: Michael Paquier @ 2020-10-06 06:35 UTC (permalink / raw)
To: Andres Freund <andres@anarazel.de>; +Cc: pgsql-committers@lists.postgresql.org
On Mon, Oct 05, 2020 at 07:38:02PM -0700, Andres Freund wrote:
> My compiler quite justifiably complains about:
Thanks, fixed.
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) download
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2020-10-06 06:35 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-10-02 00:41 pgsql: Add block information in error context of WAL REDO apply loop Michael Paquier <michael@paquier.xyz>
2020-10-06 02:38 ` Andres Freund <andres@anarazel.de>
2020-10-06 06:35 ` Michael Paquier <michael@paquier.xyz>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox