Re: Add the replication origin name and commit-LSN to logical replication worker errcontext

From: Peter Smith <smithpb2250(at)gmail(dot)com>
To: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Add the replication origin name and commit-LSN to logical replication worker errcontext
Date: 2022-03-02 02:54:31
Message-ID: CAHut+PtLJQDcGPVPO01546jKWoXOOZM8cFGqRGC0mxBUripaHA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Feb 28, 2022 at 11:16 PM Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> wrote:
>
> Hia,
>
> We've added some information such as the command and the timestamp to
> the error context message by commit abc0910e2. This patch adds further
> information to it: replication origin name and commit-LSN.
>
> This will be helpful for users to set the origin name and LSN to
> pg_replication_origin_advance().
>
> The errcontext message would become like follows:
>
> *Before
> ERROR: duplicate key value violates unique constraint "test_pkey"
> DETAIL: Key (c)=(1) already exists.
> CONTEXT: processing remote data during "INSERT" for replication
> target relation "public.test" in transaction 726 at 2022-02-28
> 20:59:56.005909+09
>
> * After
> ERROR: duplicate key value violates unique constraint "test_pkey"
> DETAIL: Key (c)=(1) already exists.
> CONTEXT: processing remote data during "INSERT" for replication
> target relation "public.test" in transaction 726 committed at LSN
> 0/14BFA88 and timestamp 2022-02-28 20:58:27.964238+09 from replication
> origin "pg_16395"
>
> I'm a bit concerned that the message may be too long.

If you are willing to use abbreviations instead of full
words/sentences perhaps you can shorten the long CONTEXT part like
below?

Before:
CONTEXT: processing remote data during "INSERT" for replication
target relation "public.test" in transaction 726 committed at LSN
0/14BFA88 and timestamp 2022-02-28 20:58:27.964238+09 from
replication origin "pg_16395"

After:
CONTEXT: processing remote data during "INSERT" for replication target
relation "public.test" (txid 726, LSN 0/14BFA88, ts 2022-02-28
20:58:27.964238+09, origin "pg_16395")

------
Kind Regards,
Peter Smith.
Fujitsu Australia.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2022-03-02 02:55:13 Re: Add the replication origin name and commit-LSN to logical replication worker errcontext
Previous Message Wenjing Zeng 2022-03-02 02:52:54 Re: [Proposal] Global temporary tables