Re: BUG #17973: Reinit of pgstats entry for dropped DB can break autovacuum daemon

From: Andres Freund <andres(at)anarazel(dot)de>
To: will(at)extrahop(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17973: Reinit of pgstats entry for dropped DB can break autovacuum daemon
Date: 2023-06-14 22:30:12
Message-ID: 20230614223012.cfyzxyfnt3ggqkt4@awork3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

On 2023-06-14 14:57:44 -0700, Andres Freund wrote:
> If I am not, then we we should defer setting MyDatabaseId until after "Recheck
> pg_database", e.g. by setting 'dboid' for the in_dbname path.
>
> I think that would likely end up with *less* code than before, because we'd
> need less redundant code.
>
>
> It's a bit odd that we do the second lookup with dbname, rather the oid we
> previously looked up.
>
>
> Afaics there's no reason to look up MyDatabaseTableSpace before the recheck.

Attached is a rough prototype implementing this idea. Could you check if that
fixes the issue?

Greetings,

Andres Freund

Attachment Content-Type Size
pgstat-mydatabase-fix-prototype.diff text/x-diff 4.9 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Andres Freund 2023-06-14 22:49:28 Re: BUG #17975: Nested Loop Index Scan returning wrong result
Previous Message Andres Freund 2023-06-14 22:15:03 Re: BUG #17974: Walsenders memory usage suddenly spike to 80G+ causing OOM and server reboot