On Wed, Jul 27, 2022 at 06:21:07PM +1200, Thomas Munro wrote:
> Erm, let me try that again, this time with the CloseTransientFile()
> also under the lock, so that we never have a file handle without a
> lock.
Right. The whole write_relmap_file() already happens while taking
RelationMappingLock, so that seems like a good idea for consistency at
the end (even if I remember that there is a patch floating around to
improve the concurrency of pgrename, which may become an easier move
now that we require Windows 10).
I have tested three runs and that was working here even if the
issue is sporadic, so more runs may be better to have more
confidence.
--
Michael