Re: Temporary tables prevent autovacuum, leading to XID wraparound - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Temporary tables prevent autovacuum, leading to XID wraparound
Date
Msg-id 20180808084127.azivmkge4lxhs2ry@alap3.anarazel.de
Whole thread Raw
In response to Re: Temporary tables prevent autovacuum, leading to XID wraparound  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Temporary tables prevent autovacuum, leading to XID wraparound
List pgsql-hackers
Hi,

On 2018-07-30 16:59:16 +0900, Michael Paquier wrote:
> +    /*
> +     * Mark MyProc as owning this namespace which other processes can use to
> +     * decide if a temporary namespace is in use or not. Even if this is an
> +     * atomic operation, this can be safely done lock-less as no temporary
> +     * relations associated to it can be seen yet if scanning pg_class.
> +     */
> +    MyProc->tempNamespaceId = namespaceId;

I can't parse this. "Even if this is an    atomic operation, this can be
safely done lock-less" - that seems like a contradictory sentence. Is
there a "not" missing?

Also, this seems like insufficient reasoning. What guarantees the
visibility of the flag? You're going to have to talk about externally
implied memory ordering here.  Or add explicit barriers - the latter is
probably preferrable.

Greetings,

Andres Freund


pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Temporary tables prevent autovacuum, leading to XID wraparound
Next
From: David Rowley
Date:
Subject: Re: Internal error XX000 with enable_partition_pruning=on, pg 11beta1 on Debian