Add information to rm_redo_error_callback()

Drouvot, Bertrand <bdrouvot@amazon.com>

From: "Drouvot, Bertrand" <bdrouvot@amazon.com>
To: PostgreSQL-development <pgsql-hackers@postgresql.org>
Cc: Masahiko Sawada <masahiko.sawada@2ndquadrant.com>
Date: 2020-08-04T15:37:05Z
Lists: pgsql-hackers

Attachments

Hi hackers,

I've attached a small patch to add information to rm_redo_error_callback().

The changes attached in this patch came while working on the "Add 
information during standby recovery conflicts" patch (See [1]).

The goal is to add more information during the callback (if doable), so 
that something like:

2020-08-04 14:42:57.545 UTC [15459] CONTEXT:  WAL redo at 0/4A3B0DE0 for 
Heap2/CLEAN: remxid 1168

would get extra information that way:

2020-08-04 14:42:57.545 UTC [15459] CONTEXT:  WAL redo at 0/4A3B0DE0 for 
Heap2/CLEAN: remxid 1168, blkref #0: rel 1663/13586/16850 fork main blk 0

As this could be useful outside of [1], a dedicated "sub" patch has been 
created (thanks Sawada for the suggestion).

I will add this patch to the next commitfest. I look forward to your 
feedback about the idea and/or implementation.

Regards,

Bertrand

[1]: https://commitfest.postgresql.org/29/2604

Commits

  1. Add block information in error context of WAL REDO apply loop