pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: florisvannee@optiver.com
Cc: andres@anarazel.de
Cc: bertranddrouvot.pg@gmail.com
Cc: tgl@sss.pgh.pa.us
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: error "can only drop stats once" brings down database
Date: Fri, 14 Jun 2024 09:37:35 +0900
Message-ID: <ZmuQz8IN6MpLxKs8@paquier.xyz> (raw)
In-Reply-To: <20240611.164457.1388765109177375375.horikyota.ntt@gmail.com>
References: <2cb577e176774caca28c724898768a38@Optiver.com>
	<ZmafJO3lpMjbyHXv@paquier.xyz>
	<e6a0bc8861b64acabce57c88e8e2c029@Optiver.com>
	<20240611.164457.1388765109177375375.horikyota.ntt@gmail.com>

On Tue, Jun 11, 2024 at 04:44:57PM +0900, Kyotaro Horiguchi wrote:
> We don't simply allow double-drop; instead, we permit this kind of
> behavior only during recovery by signaling the redo-execution
> functions with the parameter isRedo, like smgr_unlink().

Still, the case is different here, no?  Recovery forgives unlinks as
long as we are in crash recovery, or consistency has not been reached
on a standby.  This case is different: we are in a consistent state
and a backend on the standby still holds references to the stats entry
that is transparently reused after a wraparound.

I am wondering if we should tackle this problem by adding a notion of
"age" in the stats entries for what's stored in the central dshash and
in the hold copies in the backends, so as we dump the "age" of an
existing stats entry if we find out that it gets reused in a create
path.  That requires some design and would not be backpatchable, but
it does not seem that invasive at quick glance (I had my eyes on this
code the full week).  Other thoughts are welcome.
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (26+ messages)  latest in thread

Message-ID: <ZmuQz8IN6MpLxKs8@paquier.xyz>
Permalink:  ../ZmuQz8IN6MpLxKs8@paquier.xyz/
Also on:    postgresql.org/message-id/ZmuQz8IN6MpLxKs8@paquier.xyz

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: michael@paquier.xyz, horikyota.ntt@gmail.com, florisvannee@optiver.com, andres@anarazel.de, bertranddrouvot.pg@gmail.com, tgl@sss.pgh.pa.us, pgsql-bugs@lists.postgresql.org
  Subject: Re: error "can only drop stats once" brings down database
  In-Reply-To: <ZmuQz8IN6MpLxKs8@paquier.xyz>

* 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