Re: error "can only drop stats once" brings down database

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Floris Van Nee <florisvannee(at)Optiver(dot)com>
Cc: "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: error "can only drop stats once" brings down database
Date: 2024-05-03 19:32:26
Message-ID: 2730848.1714764746@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Floris Van Nee <florisvannee(at)Optiver(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Alexander Lakhin 2024-05-03 20:00:00 Re: error "can only drop stats once" brings down database
Previous Message Floris Van Nee 2024-05-03 18:10:05 RE: error "can only drop stats once" brings down database