Re: archive modules
Nathan Bossart <nathandbossart@gmail.com>
From: Nathan Bossart <nathandbossart@gmail.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: "Bossart, Nathan" <bossartn@amazon.com>, David Steele <david@pgmasters.net>, Fujii Masao <masao.fujii@oss.nttdata.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>, Michael Paquier <michael@paquier.xyz>, Magnus Hagander <magnus@hagander.net>, Stephen Frost <sfrost@snowman.net>
Date: 2022-01-28T20:01:38Z
Lists: pgsql-hackers
On Fri, Jan 28, 2022 at 02:06:50PM -0500, Robert Haas wrote: > I've committed 0001 now. I don't see anything particularly wrong with > the rest of this either, but here are a few comments: Thanks! > - I wonder whether it might be better to promote the basic archiving > module to contrib (as compared with src/test/modules) and try to > harden it to the extent that such hardening is required. I think a lot > of people would get good use out of that. It might not be a completely > baked solution, but a solution doesn't have to be completely baked to > be a massive improvement over the stupidity endorsed by our current > documentation. This has been suggested a few times in this thread, so I'll go ahead and move it to contrib. I am clearly outnumbered! :) I discussed the two main deficiencies I'm aware of with basic_archive earlier [0]. The first one is the issue with "incovenient" server crashes (mentioned below). The second is that there is no handling for multiple servers writing to the same location since the temporary file is always named "archtemp." I thought about a few ways to pick a unique file name (or at least one that is _probably_ unique), but that began adding a lot of complexity for something I intended as a test module. I can spend some more time on this if you think it's worth fixing for a contrib module. > - I wonder whether it's a good idea to silently succeed if the file > exists and has the same contents as the file we're trying to archive. > ISTR that being necessary behavior for robustness, because what if we > archive the file and then die before recording the fact that we > archived it? Yes. The only reason I didn't proceed with this earlier is because the logic became a sizable chunk of the module. I will add this in the next revision. > - If we load a new archive library, should we give the old one a > callback so it can shut down? And should the archiver considering > exiting since we can't unload? It isn't necessary but it might be > nicer. Good idea. I'll look into this. > - I believe we decided some time back to invoke function pointers > (*like)(this) rather than like(this) for clarity. It was judged that > something->like(this) was fine because that can only be a function > pointer, so no need to write (*(something->like))(this), but > like(this) could make you think that "like" is a plain function rather > than a function pointer. Will fix. [0] https://postgr.es/m/A30D8D33-8944-4898-BCA8-C77C18258247%40amazon.com -- Nathan Bossart Amazon Web Services: https://aws.amazon.com/
Commits
-
Disallow setting archive_library and archive_command at the same time
- d627ce3b706d 16.0 landed
-
Restore archive_command documentation
- ba50834551f9 16.0 landed
- 5f56933ea5d5 15.0 landed
-
Doc: improve explanation of when custom GUCs appear in pg_settings.
- 44a51dc990cc 15.0 landed
- 857808a4116b 16.0 landed
-
doc: Add note about re-archiving of same WAL files in docs.
- 3cabe45a819f 16.0 cited
-
In basic_archive tests, insist on wal_level='replica'.
- 00c360a89c1a 15.0 landed
-
Allow archiving via loadable modules.
- 5ef1eefd76f4 15.0 landed
-
Move the code to archive files via the shell to a separate file.
- aeb4cc9ea07a 15.0 landed