Re: START_REPLICATION SLOT causing a crash in an assert build - Mailing list pgsql-hackers

From Jaime Casanova
Subject Re: START_REPLICATION SLOT causing a crash in an assert build
Date
Msg-id YyFFhixwFK2jk6zW@ahch-to
Whole thread Raw
In response to Re: START_REPLICATION SLOT causing a crash in an assert build  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Responses Re: START_REPLICATION SLOT causing a crash in an assert build
List pgsql-hackers
On Tue, Sep 13, 2022 at 06:48:45PM +0900, Kyotaro Horiguchi wrote:
> Nice finding.
> 
> At Tue, 13 Sep 2022 00:39:45 -0500, Jaime Casanova <jcasanov@systemguards.com.ec> wrote in 
> > and the problem seems to be that after zero'ing the stats that includes
> > the name of the replication slot, this simple patch fixes it... not sure
> > if it's the right fix though...
> 
> That doesn't work. since what that function clears is not the name in
> the slot struct but that in stats entry.
> 

you're right... the curious thing is that I tested it and it worked, but
now it doesn't... maybe it was too late for me...

> The cause is what pg_stat_reset_replslot wants to do does not match
> what pgstat feature thinks as reset.
> 
[...]
> 
> Another measure would be to add the region to wipe-out on reset to
> PgStat_KindInfo, but it seems too much.. (attached)
> 

This patch solves the problem, i didn't like the other solution because
as you say it partly nullify the protection of the assertion.

-- 
Jaime Casanova
Director de Servicios Profesionales
SystemGuards - Consultores de PostgreSQL



pgsql-hackers by date:

Previous
From: Richard Guo
Date:
Subject: Re: A small typo
Next
From: Thomas Munro
Date:
Subject: Re: failing to build preproc.c on solaris with sun studio