Silly API for do_pg_start_backup()
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-hackers@lists.postgresql.org
Date: 2017-12-04T18:58:07Z
Lists: pgsql-hackers
Why is it that do_pg_start_backup() expects its callers to pass in an open DIR pointer for the pg_tblspc directory, rather than doing the AllocateDir call for itself? This complicates the callers, provides no flexibility (since do_pg_start_backup() is hardwired to know that pg_tblspc is what it was passed), and it doesn't seem to me to offer any robustness either. There are a couple of comments suggesting that somebody thought that opening the directory early might be good, but there's no defense of why, and I can't see that holding the directory open across a checkpoint request is adding robustness; if anything more the reverse, since it's a kernel resource we don't need during that phase. Barring objection I'll remove the tblspcdir parameter and have do_pg_start_backup() open and close the directory immediately around the loop where it's read, like every other case in the backend. regards, tom lane
Commits
-
Simplify do_pg_start_backup's API by opening pg_tblspc internally.
- 066bc21c0e08 11.0 landed