Re: Temporary tables versus wraparound... again - Mailing list pgsql-hackers

From Bossart, Nathan
Subject Re: Temporary tables versus wraparound... again
Date
Msg-id DDF0D1BC-261D-45C2-961C-5CBDBB41EE71@amazon.com
Whole thread Raw
In response to Re: Temporary tables versus wraparound... again  (Greg Stark <stark@mit.edu>)
List pgsql-hackers
On 10/12/21, 3:07 PM, "Greg Stark" <stark@mit.edu> wrote:
> Here's an updated patch. I added some warning messages to autovacuum.

I think this is useful optimization, and I intend to review the patch
more closely soon.  It looks reasonable to me after a quick glance.

> One thing I learned trying to debug this situation in production is
> that it's nigh impossible to find the pid of the session using a
> temporary schema. The number in the schema refers to the backendId in
> the sinval stuff for which there's no external way to look up the
> corresponding pid. It would have been very helpful if autovacuum had
> just told me which backend pid to kill.

I certainly think it would be good to have autovacuum log the PID, but
IIUC a query like this would help you map the backend ID to the PID:

        SELECT bid, pg_stat_get_backend_pid(bid) AS pid FROM pg_stat_get_backend_idset() bid;

Nathan


pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: GUC flags
Next
From: Andres Freund
Date:
Subject: Re: Skip vacuum log report code in lazy_scan_heap() if possible