Re: [PATCH] Atomic pgrename on Windows

Alexander Korotkov <[email protected]>
Newsgroups gmane.comp.db.postgresql.devel.general
Message-ID <CAPpHfdsZUmiwP1XjDXPRm_YEvaX_V=o=g037Xd7gj9Ma3QxgUw@mail.gmail.com>
Hi!

On Tue, Jan 7, 2020 at 7:16 PM Tomas Vondra
<[email protected]> wrote:
> I don't have access to a Windows machine and my developer experience
> with that platform is pretty much nil, but I think this patch makes
> sense. It's not an ideal solution, but it's not clear such solution
> exists, and an improvement is better than nothing.

Thank you for your attention to this patch!

> I have two minor comments about rename_temp:
>
> 1) The name might seem to be hinting it's about files opened using
> OpenTemporaryFile, but in practice it's about files that are not
> critical. But maybe it's true.


We may invent another name.  What about rename_fragile()?

> 2) I think the rename_temp comment should mention it can only be used in
> cases when the renames happen in a single process (non-concurrently). If
> we could call rename_temp() concurrently from two different processes,
> it won't work as expected. Of course, we only call rename_temp from stat
> collector and syslogger, where it obviously works.

Good point, this should be reflected in comments.

> Anyway, I'm really nitpicking here ...
>
> Are there any objections to get the current patch committed as is, so
> that it does not get pushed yet again to the next commitfest.

It would be good to commit.  Let's get agreement on function name first.

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.