Re: thinko in basic_archive.c
Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
From: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Nathan Bossart <nathandbossart@gmail.com>, pgsql-hackers@postgresql.org
Date: 2022-10-18T13:24:22Z
Lists: pgsql-hackers
Attachments
- v1-0001-Remove-leftover-temporary-files-via-basic_archive.patch (application/x-patch) patch v1-0001
On Mon, Oct 17, 2022 at 6:45 PM Robert Haas <robertmhaas@gmail.com> wrote: > > On Fri, Oct 14, 2022 at 4:45 AM Bharath Rupireddy > <bharath.rupireddyforpostgres@gmail.com> wrote: > > What happens to the left-over temp files after a server crash? Will > > they be lying around in the archive directory? I understand that we > > can't remove such files because we can't distinguish left-over files > > from a crash and the temp files that another server is in the process > > of copying. > > Yeah, leaving a potentially unbounded number of files around after > system crashes seems pretty unfriendly. I'm not sure how to fix that, > exactly. A simple server restart while the basic_archive module is copying to/from temp file would leave the file behind, see[1]. I think we can fix this by defining shutdown_cb for the basic_archive module, like the attached patch. While this helps in most of the crashes, but not all. However, this is better than what we have right now. [1] ubuntu:~/postgres/contrib/basic_archive/archive_directory$ ls 000000010000000000000001 archtemp.000000010000000000000002.2493876.1666091933457 archtemp.000000010000000000000002.2495316.1666091958680 -- Bharath Rupireddy PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com
Commits
-
Fix calculation related to temporary WAL segment name in basic_archive
- 9ebcb5ffdf3a 15.1 landed
- c68a1839902d 16.0 landed