Re: [HACKERS] logical decoding of two-phase transactions

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: vignesh C <vignesh21(at)gmail(dot)com>
Cc: Ajin Cherian <itsajin(at)gmail(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] logical decoding of two-phase transactions
Date: 2021-03-08 12:55:09
Message-ID: CAA4eK1JtEu8FS6mb8mKds7tB53zaRCM1COdgUouq-nANp52Ovg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Mar 8, 2021 at 4:20 PM vignesh C <vignesh21(at)gmail(dot)com> wrote:
>
> On Mon, Mar 8, 2021 at 11:30 AM Ajin Cherian <itsajin(at)gmail(dot)com> wrote:
> >
> > On Fri, Mar 5, 2021 at 9:25 PM vignesh C <vignesh21(at)gmail(dot)com> wrote:
> >
> >
> > Created new patch v53:
>
> Thanks for the updated patch.
> I had noticed one issue, publisher does not get stopped normally in
> the following case:
> # Publisher steps
> psql -d postgres -c "CREATE TABLE do_write(id serial primary key);"
> psql -d postgres -c "INSERT INTO do_write VALUES(generate_series(1,10));"
> psql -d postgres -c "CREATE PUBLICATION mypub FOR TABLE do_write;"
>
> # Subscriber steps
> psql -d postgres -p 9999 -c "CREATE TABLE do_write(id serial primary key);"
> psql -d postgres -p 9999 -c "INSERT INTO do_write VALUES(1);" # to
> cause a PK violation
> psql -d postgres -p 9999 -c "CREATE SUBSCRIPTION mysub CONNECTION
> 'host=localhost port=5432 dbname=postgres' PUBLICATION mypub WITH
> (two_phase = true);"
>
> # prepare & commit prepared at publisher
> psql -d postgres -c \
> "begin; insert into do_write values (100); prepare transaction 'test1';"
> psql -d postgres -c "commit prepared 'test1';"
>
> Stop publisher:
> ./pg_ctl -D publisher stop
> waiting for server to shut
> down...............................................................
> failed
> pg_ctl: server does not shut down
>
> This is because the following process does not exit:
> postgres: walsender vignesh 127.0.0.1(41550) START_REPLICATION
>
> It continuously loops at the below:
>

What happens if you don't set the two_phase option? If that also leads
to the same error then can you please also check this case on the
HEAD?

--
With Regards,
Amit Kapila.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2021-03-08 12:58:03 Re: Huge memory consumption on partitioned table with FKs
Previous Message Andy Fan 2021-03-08 12:53:33 Re: Huge memory consumption on partitioned table with FKs