Re: Failed Assert in pgstat_assoc_relation

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: vignesh C <vignesh21(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Failed Assert in pgstat_assoc_relation
Date: 2022-11-28 21:33:20
Message-ID: 759774.1669671200@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)anarazel(dot)de> writes:
> Something like the attached. Still needs a bit of polish, e.g. adding the test
> case from above.

> I'm a bit uncomfortable adding a function call below
> * Perform swapping of the relcache entry contents. Within this
> * process the old entry is momentarily invalid, so there *must* be no
> * possibility of CHECK_FOR_INTERRUPTS within this sequence. Do it in
> * all-in-line code for safety.

Ugh. I don't know what pgstat_unlink_relation does, but assuming
that it can never throw an error seems like a pretty bad idea,
especially when you aren't adding that to its API spec (contrast
the comments for MemoryContextSetParent).

Can't that part be done outside the critical section?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2022-11-28 21:44:33 Re: CF 2022-11: entries "Ready for Committer" with recent activity
Previous Message Andrey Borodin 2022-11-28 21:31:39 Re: An attempt to avoid locally-committed-but-not-replicated-to-standby-transactions in synchronous replication