pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jaime Casanova <jcasanov@systemguards.com.ec>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@postgresql.org
Subject: Re: START_REPLICATION SLOT causing a crash in an assert build
Date: Fri, 9 Sep 2022 12:51:45 -0500
Message-ID: <Yxt9MTeOvPKWnRHG@ahch-to> (raw)
In-Reply-To: <20220907193908.prfnxnt6diao2fli@awork3.anarazel.de>
References: <YxfagaTXUNa9ggLb@ahch-to>
	<20220907193908.prfnxnt6diao2fli@awork3.anarazel.de>

On Wed, Sep 07, 2022 at 12:39:08PM -0700, Andres Freund wrote:
> Hi,
> 
> On 2022-09-06 18:40:49 -0500, Jaime Casanova wrote:
> > I'm not sure what is causing this, but I have seen this twice. The
> > second time without activity after changing the set of tables in a
> > PUBLICATION.
> 
> Can you describe the steps to reproduce?
> 

I'm still trying to determine that

> Which git commit does this happen on?
> 

6e55ea79faa56db85a2b6c5bf94cee8acf8bfdb8 (Stamp 15beta4) 

> 
> > gdb says that debug_query_string contains:
> > 
> > """
> > START_REPLICATION SLOT "sub_pgbench" LOGICAL 0/0 (proto_version '3', publication_names '"pub_pgbench"')START_REPLICATION SLOT "sub_pgbench" LOGICAL 0/0 (proto_version '3', publication_names '"pub_pgbench"')
> > """
> > 
> > attached the backtrace.
> > 
> 
> > #2  0x00005559bfd4f0ed in ExceptionalCondition (
> >     conditionName=0x5559bff30e20 "namestrcmp(&statent->slotname, NameStr(slot->data.name)) == 0", errorType=0x5559bff30e0d "FailedAssertion", fileName=0x5559bff30dbb "pgstat_replslot.c", 
> >     lineNumber=89) at assert.c:69
> 
> what are statent->slotname and slot->data.name?
> 

slot->data.name seems to be the replication_slot record, and
statent->slotname comes from the in shared memory stats for that slot.

And the assert happens when &statent->slotname.data comes empty, which 
is not frequent but it happens from time to time

btw, while I'm looking at this I found that we can drop a publication
while there are active subscriptions pointing to it, is that something
we should allow?
anyway, that is not the cause of this because the replication slot actually
exists.

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





view thread (33+ messages)  latest in thread

Message-ID: <Yxt9MTeOvPKWnRHG@ahch-to>
Permalink:  ../Yxt9MTeOvPKWnRHG@ahch-to/
Also on:    postgresql.org/message-id/Yxt9MTeOvPKWnRHG@ahch-to

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: jcasanov@systemguards.com.ec, andres@anarazel.de
  Subject: Re: START_REPLICATION SLOT causing a crash in an assert build
  In-Reply-To: <Yxt9MTeOvPKWnRHG@ahch-to>
  References: <YxfagaTXUNa9ggLb@ahch-to> <20220907193908.prfnxnt6diao2fli@awork3.anarazel.de> <Yxt9MTeOvPKWnRHG@ahch-to>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox