Fix assertion failure at end of PITR.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Fri, 28 Nov 2014 07:23:41 +0000 (09:23 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Fri, 28 Nov 2014 07:31:53 +0000 (09:31 +0200)
commitafeacd274830d1e3d15ffc4e4d4b08a887f76abb
tree056d8a799e7ad9f5ed9fb32b75a00dddb496ca79
parenta5eb85eb6266c99f79144201f1162e5106969575
Fix assertion failure at end of PITR.

InitXLogInsert() cannot be called in a critical section, because it
allocates memory. But CreateCheckPoint() did that, when called for the
end-of-recovery checkpoint by the startup process.

In the passing, fix the scratch space allocation in InitXLogInsert to go to
the right memory context. Also update the comment at InitXLOGAccess, which
hasn't been totally accurate since hot standby was introduced (in a hot
standby backend, InitXLOGAccess isn't called at backend startup).

Reported by Michael Paquier
src/backend/access/transam/xlog.c
src/backend/access/transam/xloginsert.c