mirror of
https://github.com/postgres/postgres.git
synced 2025-07-31 22:04:40 +03:00
Comment changes to show bgwriter no longer performs checkpoints.
This commit is contained in:
@ -8001,8 +8001,8 @@ RecoveryRestartPoint(const CheckPoint *checkPoint)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copy the checkpoint record to shared memory, so that bgwriter can use
|
* Copy the checkpoint record to shared memory, so that checkpointer
|
||||||
* it the next time it wants to perform a restartpoint.
|
* can work out the next time it wants to perform a restartpoint.
|
||||||
*/
|
*/
|
||||||
SpinLockAcquire(&xlogctl->info_lck);
|
SpinLockAcquire(&xlogctl->info_lck);
|
||||||
XLogCtl->lastCheckPointRecPtr = ReadRecPtr;
|
XLogCtl->lastCheckPointRecPtr = ReadRecPtr;
|
||||||
@ -10151,7 +10151,7 @@ XLogPageRead(XLogRecPtr *RecPtr, int emode, bool fetching_ckpt,
|
|||||||
if (readFile >= 0 && !XLByteInSeg(*RecPtr, readId, readSeg))
|
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.
|
* xlog since the last one.
|
||||||
*/
|
*/
|
||||||
if (StandbyMode && bgwriterLaunched)
|
if (StandbyMode && bgwriterLaunched)
|
||||||
|
@ -847,7 +847,7 @@ dropdb(const char *dbname, bool missing_ok)
|
|||||||
pgstat_drop_database(db_id);
|
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
|
* in the database; else the fsyncs will fail at next checkpoint, or
|
||||||
* worse, it will delete files that belong to a newly created database
|
* worse, it will delete files that belong to a newly created database
|
||||||
* with the same OID.
|
* with the same OID.
|
||||||
@ -855,9 +855,9 @@ dropdb(const char *dbname, bool missing_ok)
|
|||||||
ForgetDatabaseFsyncRequests(db_id);
|
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
|
* 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.
|
* fail.
|
||||||
*/
|
*/
|
||||||
RequestCheckpoint(CHECKPOINT_IMMEDIATE | CHECKPOINT_FORCE | CHECKPOINT_WAIT);
|
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
|
* process any pending unlink requests. Otherwise, the check for existing
|
||||||
* files in the target directory might fail unnecessarily, not to mention
|
* files in the target directory might fail unnecessarily, not to mention
|
||||||
* that the copy might fail due to source files getting deleted under it.
|
* 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.
|
* files, which would cause rmdir() to fail.
|
||||||
*/
|
*/
|
||||||
RequestCheckpoint(CHECKPOINT_IMMEDIATE | CHECKPOINT_FORCE | CHECKPOINT_WAIT);
|
RequestCheckpoint(CHECKPOINT_IMMEDIATE | CHECKPOINT_FORCE | CHECKPOINT_WAIT);
|
||||||
|
@ -114,11 +114,6 @@ BackgroundWriterMain(void)
|
|||||||
/*
|
/*
|
||||||
* Properly accept or ignore signals the postmaster might send us
|
* 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
|
* SIGUSR1 is presently unused; keep it spare in case someday we want this
|
||||||
* process to participate in ProcSignal signalling.
|
* process to participate in ProcSignal signalling.
|
||||||
*/
|
*/
|
||||||
@ -129,7 +124,7 @@ BackgroundWriterMain(void)
|
|||||||
pqsignal(SIGALRM, SIG_IGN);
|
pqsignal(SIGALRM, SIG_IGN);
|
||||||
pqsignal(SIGPIPE, SIG_IGN);
|
pqsignal(SIGPIPE, SIG_IGN);
|
||||||
pqsignal(SIGUSR1, SIG_IGN); /* reserve for ProcSignal */
|
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
|
* Reset some signals that are accepted by postmaster but not here
|
||||||
@ -359,7 +354,7 @@ BgSigHupHandler(SIGNAL_ARGS)
|
|||||||
got_SIGHUP = true;
|
got_SIGHUP = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* SIGUSR2: set flag to run a shutdown checkpoint and exit */
|
/* SIGTERM: set flag to shutdown and exit */
|
||||||
static void
|
static void
|
||||||
ReqShutdownHandler(SIGNAL_ARGS)
|
ReqShutdownHandler(SIGNAL_ARGS)
|
||||||
{
|
{
|
||||||
|
@ -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
|
receive all the WAL, including the shutdown checkpoint, before the master
|
||||||
is shut down. Therefore postmaster treats walsenders like the pgarch process,
|
is shut down. Therefore postmaster treats walsenders like the pgarch process,
|
||||||
and instructs them to terminate at PM_SHUTDOWN_2 phase, after all regular
|
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
|
When postmaster accepts a connection, it immediately forks a new process
|
||||||
to handle the handshake and authentication, and the process initializes to
|
to handle the handshake and authentication, and the process initializes to
|
||||||
|
Reference in New Issue
Block a user