On Thu, Nov 18, 2021 at 5:34 AM Bharath Rupireddy <bharath.rupireddyforpostg...@gmail.com> wrote: > The startup process main function looks to be to do some > initialization required for recovery and do the recovery, exit if it > is a crash recovery or stay there if it is a standby recovery. Apart > from these I'm not sure it does any non-recovery tasks. Does the > startup process have any relevance or work to do if the server state > is DB_SHUTDOWNED i.e the server was shutdown properly? I think yes, > although it doesn't enter the recovery/REDO loop, it does a bunch of > other things like updating the control file, pre-allocating WAL files, > updating shared memory state to allow other backends to write WAL and > so on.
That's true, but those tasks are very brief. Nobody's going to get too confused by a "recovery" process that shows up for a few milliseconds when there's no recovery to be done. Having a "startup" process that sticks around forever on a standy, though, actually is confusing. -- Robert Haas EDB: http://www.enterprisedb.com