Re: [PATCH] Atomic pgrename on Windows

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>
Cc: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Atomic pgrename on Windows
Date: 2020-01-07 20:04:39
Message-ID: 20618.1578427479@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru> writes:
> I'm not sure issue we faced is really about single platform. TBH, the
> assumptions we place to rename function is very strict. We assume
> rename works atomically on system crash. And we indirectly assume it
> can work concurrently as least with file readers. The both are
> probably true for Linux with most popular filesystems. But we do
> support pretty many platforms. I think the issue we didn't
> investigate rename properties well on all of them. But if we do, it
> might happen some assumptions are wrong on multiple platforms.
> Windows is just used busy enough to spot the problem.

Well, atomic rename is required by POSIX. True, we have found bugs
related to that in one or two Unix-ish platforms. But nobody
is going to deny that those are OS bugs that the OS ought to fix,
rather than accepted behaviors that applications have to find
some way to work around. I'm not pleased with the idea that
Windows' deficiencies in this area should result in kluges all over
our code. I think we should stick to the autoconf recommendation:

Autoconf follows a philosophy that was formed over the years by
those who have struggled for portability: isolate the portability
issues in specific files, and then program as if you were in a
Posix environment.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2020-01-07 20:37:55 Re: jsonb_set() strictness considered harmful to data
Previous Message Robert Haas 2020-01-07 19:38:49 Re: tableam vs. TOAST