Skip to content

Commit f3ebaad

Browse files
Comment changes to show bgwriter no longer performs checkpoints.
1 parent 3ba1820 commit f3ebaad

File tree

4 files changed

+10
-15
lines changed

4 files changed

+10
-15
lines changed

src/backend/access/transam/xlog.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8001,8 +8001,8 @@ RecoveryRestartPoint(const CheckPoint *checkPoint)
80018001
}
80028002

80038003
/*
8004-
* Copy the checkpoint record to shared memory, so that bgwriter can use
8005-
* it the next time it wants to perform a restartpoint.
8004+
* Copy the checkpoint record to shared memory, so that checkpointer
8005+
* can work out the next time it wants to perform a restartpoint.
80068006
*/
80078007
SpinLockAcquire(&xlogctl->info_lck);
80088008
XLogCtl->lastCheckPointRecPtr = ReadRecPtr;
@@ -10151,7 +10151,7 @@ XLogPageRead(XLogRecPtr *RecPtr, int emode, bool fetching_ckpt,
1015110151
if (readFile >= 0 && !XLByteInSeg(*RecPtr, readId, readSeg))
1015210152
{
1015310153
/*
10154-
* Signal bgwriter to start a restartpoint if we've replayed too much
10154+
* Request a restartpoint if we've replayed too much
1015510155
* xlog since the last one.
1015610156
*/
1015710157
if (StandbyMode && bgwriterLaunched)

src/backend/commands/dbcommands.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -847,17 +847,17 @@ dropdb(const char *dbname, bool missing_ok)
847847
pgstat_drop_database(db_id);
848848

849849
/*
850-
* Tell bgwriter to forget any pending fsync and unlink requests for files
850+
* Tell checkpointer to forget any pending fsync and unlink requests for files
851851
* in the database; else the fsyncs will fail at next checkpoint, or
852852
* worse, it will delete files that belong to a newly created database
853853
* with the same OID.
854854
*/
855855
ForgetDatabaseFsyncRequests(db_id);
856856

857857
/*
858-
* Force a checkpoint to make sure the bgwriter has received the message
858+
* Force a checkpoint to make sure the checkpointer has received the message
859859
* sent by ForgetDatabaseFsyncRequests. On Windows, this also ensures that
860-
* the bgwriter doesn't hold any open files, which would cause rmdir() to
860+
* background procs don't hold any open files, which would cause rmdir() to
861861
* fail.
862862
*/
863863
RequestCheckpoint(CHECKPOINT_IMMEDIATE | CHECKPOINT_FORCE | CHECKPOINT_WAIT);
@@ -1088,7 +1088,7 @@ movedb(const char *dbname, const char *tblspcname)
10881088
* process any pending unlink requests. Otherwise, the check for existing
10891089
* files in the target directory might fail unnecessarily, not to mention
10901090
* that the copy might fail due to source files getting deleted under it.
1091-
* On Windows, this also ensures that the bgwriter doesn't hold any open
1091+
* On Windows, this also ensures that background procs don't hold any open
10921092
* files, which would cause rmdir() to fail.
10931093
*/
10941094
RequestCheckpoint(CHECKPOINT_IMMEDIATE | CHECKPOINT_FORCE | CHECKPOINT_WAIT);

src/backend/postmaster/bgwriter.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,6 @@ BackgroundWriterMain(void)
114114
/*
115115
* Properly accept or ignore signals the postmaster might send us
116116
*
117-
* Note: we deliberately ignore SIGTERM, because during a standard Unix
118-
* system shutdown cycle, init will SIGTERM all processes at once. We
119-
* want to wait for the backends to exit, whereupon the postmaster will
120-
* tell us it's okay to shut down (via SIGUSR2).
121-
*
122117
* SIGUSR1 is presently unused; keep it spare in case someday we want this
123118
* process to participate in ProcSignal signalling.
124119
*/
@@ -129,7 +124,7 @@ BackgroundWriterMain(void)
129124
pqsignal(SIGALRM, SIG_IGN);
130125
pqsignal(SIGPIPE, SIG_IGN);
131126
pqsignal(SIGUSR1, SIG_IGN); /* reserve for ProcSignal */
132-
pqsignal(SIGUSR2, SIG_IGN); /* request shutdown */
127+
pqsignal(SIGUSR2, SIG_IGN);
133128

134129
/*
135130
* Reset some signals that are accepted by postmaster but not here
@@ -359,7 +354,7 @@ BgSigHupHandler(SIGNAL_ARGS)
359354
got_SIGHUP = true;
360355
}
361356

362-
/* SIGUSR2: set flag to run a shutdown checkpoint and exit */
357+
/* SIGTERM: set flag to shutdown and exit */
363358
static void
364359
ReqShutdownHandler(SIGNAL_ARGS)
365360
{

src/backend/replication/README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ that's not desirable for walsenders, because we want the standby servers to
6868
receive all the WAL, including the shutdown checkpoint, before the master
6969
is shut down. Therefore postmaster treats walsenders like the pgarch process,
7070
and instructs them to terminate at PM_SHUTDOWN_2 phase, after all regular
71-
backends have died and bgwriter has written the shutdown checkpoint.
71+
backends have died and checkpointer has issued the shutdown checkpoint.
7272

7373
When postmaster accepts a connection, it immediately forks a new process
7474
to handle the handshake and authentication, and the process initializes to

0 commit comments

Comments
 (0)