Re: Temporary tables versus wraparound... again

From: "Bossart, Nathan" <bossartn(at)amazon(dot)com>
To: Greg Stark <stark(at)mit(dot)edu>, Noah Misch <noah(at)leadboat(dot)com>
Cc: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Temporary tables versus wraparound... again
Date: 2021-12-03 01:10:42
Message-ID: DDF0D1BC-261D-45C2-961C-5CBDBB41EE71@amazon.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 10/12/21, 3:07 PM, "Greg Stark" <stark(at)mit(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2021-12-03 01:13:44 Re: Skip vacuum log report code in lazy_scan_heap() if possible
Previous Message Michael Paquier 2021-12-03 01:06:47 Re: GUC flags