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

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

On Tue, May 25, 2021 at 4:41 PM tanghy(dot)fnst(at)fujitsu(dot)com
<tanghy(dot)fnst(at)fujitsu(dot)com> wrote:

> > Fixed in v77-0001
>
> I noticed this modification in v77-0001 and executed "CREATE SUBSCRIPTION ... WITH (two_phase = on, copy_data = false)", but it crashed.
> -------------
> postgres=# CREATE SUBSCRIPTION sub CONNECTION 'dbname=postgres' PUBLICATION pub WITH(two_phase = on, copy_data = false);
> WARNING: relcache reference leak: relation "pg_subscription" not closed
> WARNING: snapshot 0x34278d0 still active
> NOTICE: created replication slot "sub" on publisher
> server closed the connection unexpectedly
> This probably means the server terminated abnormally
> before or while processing the request.
> The connection to the server was lost. Attempting reset: Failed.
> !?>
> -------------
>
> There are two warnings and a segmentation fault in subscriber log:
> -------------
> 2021-05-24 15:08:32.435 CST [2848572] WARNING: relcache reference leak: relation "pg_subscription" not closed
> 2021-05-24 15:08:32.435 CST [2848572] WARNING: snapshot 0x32ce8b0 still active
> 2021-05-24 15:08:33.012 CST [2848555] LOG: server process (PID 2848572) was terminated by signal 11: Segmentation fault
> 2021-05-24 15:08:33.012 CST [2848555] DETAIL: Failed process was running: CREATE SUBSCRIPTION sub CONNECTION 'dbname=postgres' PUBLICATION pub WITH(two_phase = on, copy_data = false);
> -------------
>

Hi Tang,
I've attached a patch that fixes this issue. Do test and confirm.

regards,
Ajin Cherian
Fujitsu Australia

Attachment Content-Type Size
v79-0002-Add-prepare-API-support-for-streaming-transactio.patch application/octet-stream 57.8 KB
v79-0003-Skip-empty-transactions-for-logical-replication.patch application/octet-stream 24.5 KB
v79-0001-Add-support-for-prepared-transactions-to-built-i.patch application/octet-stream 146.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bharath Rupireddy 2021-05-26 14:14:47 Re: CREATE COLLATION - check for duplicate options and error out if found one
Previous Message vignesh C 2021-05-26 14:08:18 Re: Logical Replication - improve error message while adding tables to the publication in check_publication_add_relation