OSDN Git Service

Move the responsibility for calling StartupXLOG into InitPostgres, for
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 20 Apr 2010 01:38:52 +0000 (01:38 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 20 Apr 2010 01:38:52 +0000 (01:38 +0000)
commitc670410e7fe59dffb0227ed1dd0f532013993859
treec647059112427738891c97e5e7ac0c53cce94782
parentee7769bb7649e0f990179f9ed56e60c031542077
Move the responsibility for calling StartupXLOG into InitPostgres, for
those process types that go through InitPostgres; in particular, bootstrap
and standalone-backend cases.  This ensures that we have set up a PGPROC
and done some other basic initialization steps (corresponding to the
if (IsUnderPostmaster) block in AuxiliaryProcessMain) before we attempt to
run WAL recovery in a standalone backend.  As was discovered last September,
this is necessary for some corner-case code paths during WAL recovery,
particularly end-of-WAL cleanup.

Moving the bootstrap case here too is not necessary for correctness, but it
seems like a good idea since it reduces the number of distinct code paths.
src/backend/bootstrap/bootstrap.c
src/backend/tcop/postgres.c
src/backend/utils/init/postinit.c