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

2022-03-08 Thread Masahiko Sawada
On Tue, Mar 8, 2022 at 7:56 PM Amit Kapila wrote: > > On Mon, Mar 7, 2022 at 10:06 AM Amit Kapila wrote: > > > > On Mon, Mar 7, 2022 at 6:36 AM Masahiko Sawada > > wrote: > > > > > > Thank you for the comment. +1. > > > > > > I've attached updated patches. > > > > > > > Pushed the first patch.

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

2022-03-08 Thread Amit Kapila
On Mon, Mar 7, 2022 at 10:06 AM Amit Kapila wrote: > > On Mon, Mar 7, 2022 at 6:36 AM Masahiko Sawada wrote: > > > > Thank you for the comment. +1. > > > > I've attached updated patches. > > > > Pushed the first patch. Fixed one typo in the second patch and > slightly changed the commit message,

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

2022-03-06 Thread Amit Kapila
On Mon, Mar 7, 2022 at 6:36 AM Masahiko Sawada wrote: > > Thank you for the comment. +1. > > I've attached updated patches. > Pushed the first patch. Fixed one typo in the second patch and slightly changed the commit message, otherwise, it looks good to me. I'll push this tomorrow unless there ar

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

2022-03-06 Thread Masahiko Sawada
On Fri, Mar 4, 2022 at 9:32 PM Euler Taveira wrote: > > On Fri, Mar 4, 2022, at 2:54 AM, Amit Kapila wrote: > > The LSN of the transaction that contains the change violating the > constraint and the replication origin name can be found from the > server log (LSN 0/14C0378 and replication origin >

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

2022-03-04 Thread Amit Kapila
On Fri, Mar 4, 2022 at 6:02 PM Euler Taveira wrote: > > On Fri, Mar 4, 2022, at 2:54 AM, Amit Kapila wrote: > > The LSN of the transaction that contains the change violating the > constraint and the replication origin name can be found from the > server log (LSN 0/14C0378 and replication origin >

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

2022-03-04 Thread Euler Taveira
On Fri, Mar 4, 2022, at 2:54 AM, Amit Kapila wrote: > The LSN of the transaction that contains the change violating the > constraint and the replication origin name can be found from the > server log (LSN 0/14C0378 and replication origin > pg_16395 in the above case). To skip the > transaction, th

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

2022-03-04 Thread Masahiko Sawada
On Fri, Mar 4, 2022 at 2:55 PM Amit Kapila wrote: > > On Fri, Mar 4, 2022 at 6:40 AM Masahiko Sawada wrote: > > > > Attached updated version patches. > > > > The patch looks mostly good to me. Few minor comments: Thank you for the comments! > 1. I think we can have an Assert for errarg->origin_

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

2022-03-03 Thread Amit Kapila
On Fri, Mar 4, 2022 at 11:45 AM osumi.takami...@fujitsu.com wrote: > > On Friday, March 4, 2022 2:23 PM Masahiko Sawada > wrote: > > I've attached updated patches. > Hi, thank you for updating the patch. > > One comment on v4. > > In v4-0002, we introduce 'commit_lsn' in the ApplyErrorCallbackAr

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

2022-03-03 Thread osumi.takami...@fujitsu.com
On Friday, March 4, 2022 2:23 PM Masahiko Sawada wrote: > I've attached updated patches. Hi, thank you for updating the patch. One comment on v4. In v4-0002, we introduce 'commit_lsn' in the ApplyErrorCallbackArg. This member is set for prepare, rollback prepared and stream_abort as well. The ne

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

2022-03-03 Thread Amit Kapila
On Fri, Mar 4, 2022 at 10:53 AM Masahiko Sawada wrote: > > On Fri, Mar 4, 2022 at 11:27 AM osumi.takami...@fujitsu.com > wrote: > > > > (4) one confirmation > > > > We don't have a TAP test of pg_replication_origin_advance() > > for v3, that utilizes this new log in a logical replication setup. >

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

2022-03-03 Thread Amit Kapila
On Fri, Mar 4, 2022 at 6:40 AM Masahiko Sawada wrote: > > Attached updated version patches. > The patch looks mostly good to me. Few minor comments: 1. I think we can have an Assert for errarg->origin_name in apply_error_callback after checking the command as this function assumes that it will al

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

2022-03-03 Thread Masahiko Sawada
On Fri, Mar 4, 2022 at 11:27 AM osumi.takami...@fujitsu.com wrote: > > On Friday, March 4, 2022 10:09 AM Masahiko Sawada > wrote: > > On Thu, Mar 3, 2022 at 10:02 PM Masahiko Sawada > > wrote: > > > > > > > > > I'm updating the patches and will submit them. > > > > Attached updated version patc

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

2022-03-03 Thread osumi.takami...@fujitsu.com
On Friday, March 4, 2022 10:09 AM Masahiko Sawada wrote: > On Thu, Mar 3, 2022 at 10:02 PM Masahiko Sawada > wrote: > > > > > > I'm updating the patches and will submit them. > > Attached updated version patches. Thank you for sharing the patch v3. Few minor comments. (1) v03-0001, apply_erro

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

2022-03-03 Thread Masahiko Sawada
On Thu, Mar 3, 2022 at 10:02 PM Masahiko Sawada wrote: > > > I'm updating the patches and will submit them. Attached updated version patches. Regards, -- Masahiko Sawada EDB: https://www.enterprisedb.com/ v3-0002-Add-the-origin-name-and-remote-commit-LSN-to-logi.patch Description: Binary da

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

2022-03-03 Thread Masahiko Sawada
On Thu, Mar 3, 2022 at 3:37 PM Amit Kapila wrote: > > On Wed, Mar 2, 2022 at 1:05 PM Masahiko Sawada wrote: > > > > On Wed, Mar 2, 2022 at 4:14 PM Amit Kapila wrote: > > > > I've attached updated patches. > > > > The first patch LGTM. Some comments on the second patch: > > 1. > @@ -3499,6 +3503,

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

2022-03-02 Thread Amit Kapila
On Wed, Mar 2, 2022 at 1:05 PM Masahiko Sawada wrote: > > On Wed, Mar 2, 2022 at 4:14 PM Amit Kapila wrote: > > I've attached updated patches. > The first patch LGTM. Some comments on the second patch: 1. @@ -3499,6 +3503,17 @@ ApplyWorkerMain(Datum main_arg) myslotname = MemoryContextStrdup(

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

2022-03-02 Thread Masahiko Sawada
On Wed, Mar 2, 2022 at 4:07 PM Kyotaro Horiguchi wrote: > > At Wed, 2 Mar 2022 14:39:54 +0900, Masahiko Sawada > wrote in > > On Wed, Mar 2, 2022 at 11:55 AM Amit Kapila wrote: > > > > > > On Mon, Feb 28, 2022 at 5:46 PM Masahiko Sawada > > > wrote: > > > > > > > > I've attached two patches:

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

2022-03-01 Thread Masahiko Sawada
On Wed, Mar 2, 2022 at 4:14 PM Amit Kapila wrote: > > On Wed, Mar 2, 2022 at 9:33 AM Masahiko Sawada wrote: > > > > On Wed, Mar 2, 2022 at 12:21 PM Amit Kapila wrote: > > > > > > On Wed, Mar 2, 2022 at 8:25 AM Peter Smith wrote: > > > > > > > > On Mon, Feb 28, 2022 at 11:16 PM Masahiko Sawada

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

2022-03-01 Thread Amit Kapila
On Wed, Mar 2, 2022 at 9:33 AM Masahiko Sawada wrote: > > On Wed, Mar 2, 2022 at 12:21 PM Amit Kapila wrote: > > > > On Wed, Mar 2, 2022 at 8:25 AM Peter Smith wrote: > > > > > > On Mon, Feb 28, 2022 at 11:16 PM Masahiko Sawada > > > wrote: > > > > > > > > The errcontext message would become l

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

2022-03-01 Thread Kyotaro Horiguchi
At Wed, 2 Mar 2022 14:39:54 +0900, Masahiko Sawada wrote in > On Wed, Mar 2, 2022 at 11:55 AM Amit Kapila wrote: > > > > On Mon, Feb 28, 2022 at 5:46 PM Masahiko Sawada > > wrote: > > > > > > I've attached two patches: the first one changes > > > apply_error_callback() so that it uses complet

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

2022-03-01 Thread Masahiko Sawada
On Wed, Mar 2, 2022 at 11:55 AM Amit Kapila wrote: > > On Mon, Feb 28, 2022 at 5:46 PM Masahiko Sawada wrote: > > > > I've attached two patches: the first one changes > > apply_error_callback() so that it uses complete sentences with if-else > > blocks in order to have a translation work, > > > >

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

2022-03-01 Thread Masahiko Sawada
On Wed, Mar 2, 2022 at 12:21 PM Amit Kapila wrote: > > On Wed, Mar 2, 2022 at 8:25 AM Peter Smith wrote: > > > > On Mon, Feb 28, 2022 at 11:16 PM Masahiko Sawada > > wrote: > > > > > > The errcontext message would become like follows: > > > > > > *Before > > > ERROR: duplicate key value violat

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

2022-03-01 Thread Amit Kapila
On Wed, Mar 2, 2022 at 8:25 AM Peter Smith wrote: > > On Mon, Feb 28, 2022 at 11:16 PM Masahiko Sawada > wrote: > > > > The errcontext message would become like follows: > > > > *Before > > ERROR: duplicate key value violates unique constraint "test_pkey" > > DETAIL: Key (c)=(1) already exists

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

2022-03-01 Thread Amit Kapila
On Mon, Feb 28, 2022 at 5:46 PM Masahiko Sawada wrote: > > I've attached two patches: the first one changes > apply_error_callback() so that it uses complete sentences with if-else > blocks in order to have a translation work, > This is an improvement over what we have now but I think this is sti

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

2022-03-01 Thread Peter Smith
On Mon, Feb 28, 2022 at 11:16 PM Masahiko Sawada 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

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

2022-02-28 Thread Amit Kapila
On Mon, Feb 28, 2022 at 5:46 PM Masahiko Sawada wrote: > > 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