Re: pg_upgrade test failure
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Justin Pryzby <pryzby@telsasoft.com>, Andres Freund <andres@anarazel.de>, pgsql-hackers@lists.postgresql.org
Date: 2022-10-03T00:40:20Z
Lists: pgsql-hackers
On Mon, Oct 03, 2022 at 12:10:06PM +1300, Thomas Munro wrote:
> I think something like the attached should do the right thing for
> STATUS_DELETE_PENDING (sort of "ENOENT-in-progress"). unlink() goes
> back to being blocking (sleep+retry until eventually we reach ENOENT
> or we time out and give up with EACCES), but we still distinguish it
> from true ENOENT so we have a fast exit in that case. This is passing
> CI, but not tested yet.
if (lstat(path, &st) < 0)
- return -1;
+ {
+ if (lstat_error_was_status_delete_pending())
+ is_lnk = false;
+ else
+ return -1;
+ }
+ else
+ is_lnk = S_ISLNK(st.st_mode);
Sorry, I don't remember all the details in this area, but a directory
can never be marked as STATUS_DELETE_PENDING with some of its contents
still inside, right? If it has some contents, forcing unlink() all
the time would be fine?
> One ugly thing in this patch is that it has to deal with our
> historical mistake (?) of including Windows headers in this file in
> Cygwin builds for no reason and thus getting WIN32 defined on a
> non-WIN32 build, as I've complained about before[1] but not yet tidied
> up.
Your proposal remains local to dirmod.c, so that does not sound like a
big deal to me for the time being.
--
Michael
Commits
-
ci: freebsd: stop postgres instance on failure, to prevent log upload failures
- 209f0f0e8516 16.0 landed
-
Try to fix pg_upgrade test on Windows, again.
- c28911750527 16.0 landed
-
Refactor rmtree() to use get_dirent_type().
- 54e72b66ed1a 16.0 landed
-
Fix unlink() for STATUS_DELETE_PENDING on Windows.
- e109e43921d2 16.0 landed
-
Move any remaining files generated by pg_upgrade into an internal subdir
- ee5353abb612 16.0 cited
-
Make unlink() work for junction points on Windows.
- f357233c9db8 16.0 cited
-
pg_upgrade: Move all the files generated internally to a subdirectory
- 38bfae365266 15.0 cited
-
In pg_upgrade, try a few times to open a log file.
- f8c81c5dde23 9.3.0 cited