Re: [HACKERS] logical decoding of two-phase transactions - Mailing list pgsql-hackers

From Ajin Cherian
Subject Re: [HACKERS] logical decoding of two-phase transactions
Date
Msg-id CAFPTHDYx3_jrpFE25NuBONaoybiZw4VsSYMm_3CCY_1zhrsfAQ@mail.gmail.com
Whole thread Raw
In response to RE: [HACKERS] logical decoding of two-phase transactions  ("tanghy.fnst@fujitsu.com" <tanghy.fnst@fujitsu.com>)
Responses RE: [HACKERS] logical decoding of two-phase transactions
List pgsql-hackers
On Tue, May 25, 2021 at 4:41 PM tanghy.fnst@fujitsu.com
<tanghy.fnst@fujitsu.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

pgsql-hackers by date:

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