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