Re: wrong fds used for refilenodes after pg_upgrade relfilenode changes Reply-To:

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>
Subject: Re: wrong fds used for refilenodes after pg_upgrade relfilenode changes Reply-To:
Date: 2022-05-04 02:23:57
Message-ID: CA+hUKG+ge5j_r4bDxkzL-S2zmUWrgvnG6GiN3OeVjhvofcWXVg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, May 4, 2022 at 8:53 AM Thomas Munro <thomas(dot)munro(at)gmail(dot)com> wrote:
> Got some off-list clues: that's just distracting Perl cleanup noise
> after something else went wrong (thanks Robert), and now I'm testing a
> theory from Andres that we're missing a barrier on the redo side when
> replaying XLOG_DBASE_CREATE_FILE_COPY. More soon.

Yeah, looks like that was the explanation. Presumably in older
releases, recovery can fail with EACCES here, and since commit
e2f0f8ed we get ENOENT, because someone's got an unlinked file open,
and ReadDir() can still see it. (I've wondered before if ReadDir()
should also hide zombie Windows directory entries, but that's kinda
independent and would only get us one step further, a later rmdir()
would still fail.) Adding the barrier fixes the problem. Assuming no
objections or CI failures show up, I'll consider pushing the first two
patches tomorrow.

Attachment Content-Type Size
v4-0001-Rethink-PROCSIGNAL_BARRIER_SMGRRELEASE.patch application/x-patch 6.2 KB
v4-0002-Fix-old-fd-issues-using-global-barriers-everywher.patch application/x-patch 13.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2022-05-04 03:50:39 Re: Perform streaming logical transactions by background workers and parallel apply
Previous Message David G. Johnston 2022-05-04 00:39:41 Re: SQL/JSON: FOR ORDINALITY bug