Re: Avoid erroring out when unable to remove or parse logical rewrite files to save checkpoint work
Nathan Bossart <nathandbossart@gmail.com>
From: Nathan Bossart <nathandbossart@gmail.com>
To: Andres Freund <andres@anarazel.de>
Cc: "Bossart, Nathan" <bossartn@amazon.com>, Tom Lane <tgl@sss.pgh.pa.us>, Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>, Julien Rouhaud <rjuju123@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-01-27T01:01:09Z
Lists: pgsql-hackers
Attachments
On Fri, Jan 21, 2022 at 11:49:56AM -0800, Andres Freund wrote: > On 2022-01-20 20:41:16 +0000, Bossart, Nathan wrote: >> Here's this part. > > And pushed to all branches. Thanks. Thanks! I spent some time thinking about the right way to proceed here, and I came up with the attached patches. The first patch just adds error checking for various lstat() calls in the replication code. If lstat() fails, then it probably doesn't make sense to try to continue processing the file. The second patch changes some nearby calls to ereport() to ERROR. If these failures are truly unexpected, and we don't intend to support use-cases like concurrent manual deletion, then failing might be the right way to go. I think it's a shame that such failures could cause checkpointing to continually fail, but that topic is already being discussed elsewhere [0]. [0] https://postgr.es/m/C1EE64B0-D4DB-40F3-98C8-0CED324D34CB%40amazon.com -- Nathan Bossart Amazon Web Services: https://aws.amazon.com/
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