Comment changes to show bgwriter no longer performs checkpoints.

This commit is contained in:
Simon Riggs 2011-11-01 18:48:47 +00:00
parent 3ba182056f
commit f3ebaad45b
4 changed files with 10 additions and 15 deletions

View File

@ -8001,8 +8001,8 @@ RecoveryRestartPoint(const CheckPoint *checkPoint)
}
/*
* Copy the checkpoint record to shared memory, so that bgwriter can use
* it the next time it wants to perform a restartpoint.
* Copy the checkpoint record to shared memory, so that checkpointer
* can work out the next time it wants to perform a restartpoint.
*/
SpinLockAcquire(&xlogctl->info_lck);
XLogCtl->lastCheckPointRecPtr = ReadRecPtr;
@ -10151,7 +10151,7 @@ XLogPageRead(XLogRecPtr *RecPtr, int emode, bool fetching_ckpt,
if (readFile >= 0 && !XLByteInSeg(*RecPtr, readId, readSeg))
{
/*
* Signal bgwriter to start a restartpoint if we've replayed too much
* Request a restartpoint if we've replayed too much
* xlog since the last one.
*/
if (StandbyMode && bgwriterLaunched)

View File

@ -847,7 +847,7 @@ dropdb(const char *dbname, bool missing_ok)
pgstat_drop_database(db_id);
/*
* Tell bgwriter to forget any pending fsync and unlink requests for files
* Tell checkpointer to forget any pending fsync and unlink requests for files
* in the database; else the fsyncs will fail at next checkpoint, or
* worse, it will delete files that belong to a newly created database
* with the same OID.
@ -855,9 +855,9 @@ dropdb(const char *dbname, bool missing_ok)
ForgetDatabaseFsyncRequests(db_id);
/*
* Force a checkpoint to make sure the bgwriter has received the message
* Force a checkpoint to make sure the checkpointer has received the message
* sent by ForgetDatabaseFsyncRequests. On Windows, this also ensures that
* the bgwriter doesn't hold any open files, which would cause rmdir() to
* background procs don't hold any open files, which would cause rmdir() to
* fail.
*/
RequestCheckpoint(CHECKPOINT_IMMEDIATE | CHECKPOINT_FORCE | CHECKPOINT_WAIT);
@ -1088,7 +1088,7 @@ movedb(const char *dbname, const char *tblspcname)
* process any pending unlink requests. Otherwise, the check for existing
* files in the target directory might fail unnecessarily, not to mention
* that the copy might fail due to source files getting deleted under it.
* On Windows, this also ensures that the bgwriter doesn't hold any open
* On Windows, this also ensures that background procs don't hold any open
* files, which would cause rmdir() to fail.
*/
RequestCheckpoint(CHECKPOINT_IMMEDIATE | CHECKPOINT_FORCE | CHECKPOINT_WAIT);

View File

@ -114,11 +114,6 @@ BackgroundWriterMain(void)
/*
* Properly accept or ignore signals the postmaster might send us
*
* Note: we deliberately ignore SIGTERM, because during a standard Unix
* system shutdown cycle, init will SIGTERM all processes at once. We
* want to wait for the backends to exit, whereupon the postmaster will
* tell us it's okay to shut down (via SIGUSR2).
*
* SIGUSR1 is presently unused; keep it spare in case someday we want this
* process to participate in ProcSignal signalling.
*/
@ -129,7 +124,7 @@ BackgroundWriterMain(void)
pqsignal(SIGALRM, SIG_IGN);
pqsignal(SIGPIPE, SIG_IGN);
pqsignal(SIGUSR1, SIG_IGN); /* reserve for ProcSignal */
pqsignal(SIGUSR2, SIG_IGN); /* request shutdown */
pqsignal(SIGUSR2, SIG_IGN);
/*
* Reset some signals that are accepted by postmaster but not here
@ -359,7 +354,7 @@ BgSigHupHandler(SIGNAL_ARGS)
got_SIGHUP = true;
}
/* SIGUSR2: set flag to run a shutdown checkpoint and exit */
/* SIGTERM: set flag to shutdown and exit */
static void
ReqShutdownHandler(SIGNAL_ARGS)
{

View File

@ -68,7 +68,7 @@ that's not desirable for walsenders, because we want the standby servers to
receive all the WAL, including the shutdown checkpoint, before the master
is shut down. Therefore postmaster treats walsenders like the pgarch process,
and instructs them to terminate at PM_SHUTDOWN_2 phase, after all regular
backends have died and bgwriter has written the shutdown checkpoint.
backends have died and checkpointer has issued the shutdown checkpoint.
When postmaster accepts a connection, it immediately forks a new process
to handle the handshake and authentication, and the process initializes to