}
/*
- * 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;
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)
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.
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);
* 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);
/*
* 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.
*/
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
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)
{
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