mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-18 18:44:06 +08:00
New arrangement to always let the bgwriter do checkpoints broke
CHECKPOINT and some other commands in the context of a standalone backend. Allow a standalone backend to do its own checkpoints.
This commit is contained in:
parent
254eef2f28
commit
0845ee3958
@ -37,7 +37,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/postmaster/bgwriter.c,v 1.13 2005/01/10 20:02:20 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/postmaster/bgwriter.c,v 1.13.4.1 2005/02/19 23:16:27 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -509,6 +509,23 @@ RequestCheckpoint(bool waitforit)
|
||||
sig_atomic_t old_failed = bgs->ckpt_failed;
|
||||
sig_atomic_t old_started = bgs->ckpt_started;
|
||||
|
||||
/*
|
||||
* If in a standalone backend, just do it ourselves.
|
||||
*/
|
||||
if (!IsPostmasterEnvironment)
|
||||
{
|
||||
CreateCheckPoint(false, true);
|
||||
|
||||
/*
|
||||
* After any checkpoint, close all smgr files. This is so we
|
||||
* won't hang onto smgr references to deleted files
|
||||
* indefinitely.
|
||||
*/
|
||||
smgrcloseall();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Send signal to request checkpoint. When waitforit is false, we
|
||||
* consider failure to send the signal to be nonfatal.
|
||||
|
Loading…
Reference in New Issue
Block a user