Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed at end-of-transaction
Alexander Law <exclusion@gmail.com>
From: Alexander Lakhin <exclusion@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>, Justin Pryzby <pryzby@telsasoft.com>
Cc: Fabien COELHO <coelho@cri.ensmp.fr>, pgsql-hackers@postgresql.org,
Alvaro Herrera <alvherre@2ndquadrant.com>, David Steele
<david@pgmasters.net>, "Bossart, Nathan" <bossartn@amazon.com>,
Thomas Munro <thomas.munro@gmail.com>
Date: 2020-11-13T20:00:00Z
Lists: pgsql-hackers
Hello hackers, 31.03.2020 19:41, Tom Lane wrote: > Justin Pryzby <pryzby@telsasoft.com> writes: >> I suggest to leave stat() alone in your patch for stable releases. I think >> it's okay if we change behavior so that a broken symlink is skipped instead of >> erroring (as a side effect of skipping ENOENT with stat()). But not okay if we >> change pg_ls_logdir() to hide symlinks in back braches. > Meh. I'm not really convinced, but in the absence of anyone expressing > support for my position, I'll do it that way. I don't think it's worth > doing both a stat and lstat to tell the difference between file-is-gone > and file-is-a-broken-symlink. As we've discovered in Bug #[16161], stat() for "concurrently-deleted file" can also return ERROR_ACCESS_DENIED on Windows. It seems that pg_upgradeCheck failures seen on https://buildfarm.postgresql.org/cgi-bin/show_history.pl?nm=fairywren&br=REL_13_STABLE caused by the same issue. Shouldn't pg_ls_dir_files() retry stat() on ERROR_ACCESS_DENIED just like the pgwin32_open() does to ignore files in "delete pending" state? [16161] https://www.postgresql.org/message-id/16161-7a985d2f1bbe8f71%40postgresql.org Best regards, Alexander
Commits
-
Teach pg_ls_dir_files() to ignore ENOENT failures from stat().
- ee40e8975e2c 12.3 landed
- 83f7761d84e6 10.13 landed
- 82e801852274 13.0 landed
- 5b22ff764b0f 11.8 landed
-
Remove useless pfree()s at the ends of various ValuePerCall SRFs.
- 41b45576d532 13.0 landed
-
Avoid holding a directory FD open across assorted SRF calls.
- cd6a0518794d 9.6.18 landed
- 5e4a0b7194b9 10.13 landed
- 819d5525744b 11.8 landed
- 2a89455aade3 12.3 landed
- b4570d33aa04 13.0 landed
- da254148f4de 9.5.22 landed
-
Document pg_ls_*dir hiding of directories and special files
- 8b6d94cf6c83 13.0 cited
-
Avoid holding a directory FD open across pg_ls_dir_files() calls.
- 05283dd5b579 10.13 landed
- 63b51dfec18e 11.8 landed
- 3c8864fc1c54 12.3 landed
- 085b6b6679e7 13.0 landed
-
Adjust nodeFunctionscan.c to reset transient memory context between calls
- e4186762ffaa 7.3.1 cited