Re: Dubious code in pg_rewind's process_target_file()
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-hackers@lists.postgresql.org
Date: 2020-09-05T18:18:29Z
Lists: pgsql-hackers
I wrote: > It looks to me like we could replace "exists = false" with "return", > rather than uselessly constructing a FILE_ACTION_REMOVE entry for > a file we've already proven is not there. Or actually, maybe we should just drop the lstat call altogether? AFAICS it's 99.99% redundant with the lstat that traverse_datadir has done nanoseconds before. Yeah, maybe somebody managed to drop the file in between, but the FILE_ACTION_REMOVE code would have to deal with such cases anyway in case a drop occurs later. regards, tom lane
Commits
-
Remove useless lstat() call in pg_rewind.
- be6667081e23 9.5.24 landed
- a7bcf391f329 12.5 landed
- 7d60e4183013 10.15 landed
- 75e44b471c51 11.10 landed
- 1f8c163c5acd 9.6.20 landed
- e7f06ea60a3c 13.0 landed
- 666e9a90f09a 14.0 landed