Re: Avoid erroring out when unable to remove or parse logical rewrite files to save checkpoint work
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>, Thomas Munro <thomas.munro@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, Andres Freund <andres@anarazel.de>, "Bossart, Nathan" <bossartn@amazon.com>, Julien Rouhaud <rjuju123@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-09-02T08:09:14Z
Lists: pgsql-hackers
On Wed, Aug 31, 2022 at 04:10:59PM +0900, Michael Paquier wrote: > Yeah, what you have here looks pretty fine to me, so this is IMO > committable. Let's wait a bit to see if there are any objections from > the others, in case. I had a few hours and I've spent them looking at what you had here in details, and there were a few things I have tweaked before applying the patch. First, elevel was set to LOG for three calls of get_dirent_type() in code paths where we want to skip entries. This would have become very noisy, so I've switched two of them to DEBUG1 and the third one to DEBUG2 for consistency with the surroundings. A second thing was RemoveXlogFile(), where we passed down a dirent entry *and* its d_name. With this design, it would be easy to mess up things and pass down a file name that does not match with its dirent entry, so I have finished by replacing "segname" by the dirent structure. A last thing was about the two extra comment blocks in fd.c, and I could not convince myself that these were helpful hints so I have removed both of them. -- Michael
Commits
-
Expand the use of get_dirent_type(), shaving a few calls to stat()/lstat()
- bfb9dfd93720 16.0 landed
-
fsync pg_logical/mappings in CheckPointLogicalRewriteHeap().
- fd48e5f5d3a1 13.6 landed
- f862cc09fad1 10.20 landed
- 2c15b29f7c22 11.15 landed
- 2b7dbe4bd587 14.2 landed
- 1c6d055ba77a 12.10 landed
- 1fabec7d7c38 15.0 landed
-
Introduce logical decoding.
- b89e151054a0 9.4.0 cited