From: Tom Lane <tgl@sss.pgh.pa.us>
To: Floris Van Nee <florisvannee@Optiver.com>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Cc: Andres Freund <andres@anarazel.de>
Subject: Re: error "can only drop stats once" brings down database
Date: Fri, 03 May 2024 15:32:26 -0400
Message-ID: <2730848.1714764746@sss.pgh.pa.us> (raw)
In-Reply-To: <8e5cb534706a4f43bd74405c8fd91437@Optiver.com>
References: <b14ae28029f64757bb64613be2549a74@Optiver.com>
<215498.1708454947@sss.pgh.pa.us>
<8e5cb534706a4f43bd74405c8fd91437@Optiver.com>
Floris Van Nee <florisvannee@Optiver.com> writes:
>> Hmm. This must be coming from pgstat_drop_entry_internal.
>> I suspect the correct fix is in pgstat_drop_entry, along the lines of
>>
>> - if (shent)
>> + if (shent && !shent->dropped)
>>
>> but it's not clear to me how the already-dropped case ought to affect the
>> function's bool result. Also, how are we getting into a concurrent-drop
>> situation in recovery?
> Anyone has further thoughts on this? This still happens occasionally.
I was expecting Andres to comment on it eventually. I don't know
that code well enough to want to modify it on my own authority,
especially not just before a release.
One thing that would be safe enough and perhaps useful is to
modify the "can only drop stats once" message to provide a
little more detail, like the hash key of the problematic
entry. That might help us understand what's triggering this.
The OIDs would be opaque perhaps, but the PgStat_Kind value
seems useful to know.
regards, tom lane
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: tgl@sss.pgh.pa.us, florisvannee@Optiver.com, pgsql-bugs@lists.postgresql.org, andres@anarazel.de
Subject: Re: error "can only drop stats once" brings down database
In-Reply-To: <2730848.1714764746@sss.pgh.pa.us>
* 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