pgsql: Add logical change details to logical replication worker errcont - Mailing list pgsql-committers

From Amit Kapila
Subject pgsql: Add logical change details to logical replication worker errcont
Date
Msg-id E1mJSHZ-0007t9-52@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Add logical change details to logical replication worker errcontext.

Previously, on the subscriber, we set the error context callback for the
tuple data conversion failures. This commit replaces the existing error
context callback with a comprehensive one so that it shows not only the
details of data conversion failures but also the details of logical change
being applied by the apply worker or table sync worker. The additional
information displayed will be the command, transaction id, and timestamp.

The error context is added to an error only when applying a change but not
while doing other work like receiving data etc.

This will help users in diagnosing the problems that occur during logical
replication. It also can be used for future work that allows skipping a
particular transaction on the subscriber.

Author: Masahiko Sawada
Reviewed-by: Hou Zhijie, Greg Nancarrow, Haiying Tang, Amit Kapila
Tested-by: Haiying Tang
Discussion: https://postgr.es/m/CAD21AoDeScrsHhLyEPYqN3sydg6PxAPVBboK=30xJfUVihNZDA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/abc0910e2e0adfc5a17e035465ee31242e32c4fc

Modified Files
--------------
src/backend/replication/logical/proto.c  |  53 +++++++
src/backend/replication/logical/worker.c | 259 +++++++++++++++++++++----------
src/include/replication/logicalproto.h   |   1 +
src/tools/pgindent/typedefs.list         |   2 +-
4 files changed, 235 insertions(+), 80 deletions(-)


pgsql-committers by date:

Previous
From: Peter Geoghegan
Date:
Subject: pgsql: contrib/amcheck: Add heapam CHECK_FOR_INTERRUPTS().
Next
From: Daniel Gustafsson
Date:
Subject: pgsql: Avoid invoking PQfnumber in loop constructs