On Fri, 18 Feb 2022 at 20:51, Nathan Bossart <nathandboss...@gmail.com> wrote: > > > On Thu, Feb 17, 2022 at 03:12:47PM -0800, Andres Freund wrote: > >>> > The improvements around deleting temporary files and serialized > >>> > snapshots > >>> > afaict don't require a dedicated process - they're only relevant during > >>> > startup. We could use the approach of renaming the directory out of the > >>> > way as > >>> > done in this patchset but perform the cleanup in the startup process > >>> > after > >>> > we're up. > > BTW I know you don't like the dedicated process approach, but one > improvement to that approach could be to shut down the custodian process > when it has nothing to do.
Having a central cleanup process makes a lot of sense. There is a long list of potential tasks for such a process. My understanding is that autovacuum already has an interface for handling additional workload types, which is how BRIN indexes are handled. Do we really need a new process? If so, lets do this now. Nathan's point that certain tasks are blocking fast startup is a good one and higher availability is a critical end goal. The thought that we should complete these tasks during checkpoint is a good one, but checkpoints should NOT be delayed by long running tasks that are secondary to availability. Andres' point that it would be better to avoid long running tasks is good, if that is possible. That can be done better over time. This point does not block the higher level goal of better availability asap, so I support Nathan's overall proposals. -- Simon Riggs http://www.EnterpriseDB.com/