Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
750f70b0
Commit
750f70b0
authored
Nov 02, 2011
by
Simon Riggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update more comments about checkpoints being done by bgwriter
parent
18fb9d8d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
src/backend/access/transam/xlog.c
src/backend/access/transam/xlog.c
+10
-10
No files found.
src/backend/access/transam/xlog.c
View file @
750f70b0
...
@@ -326,7 +326,7 @@ static XLogRecPtr RedoStartLSN = {0, 0};
...
@@ -326,7 +326,7 @@ static XLogRecPtr RedoStartLSN = {0, 0};
*
*
* CheckpointLock: must be held to do a checkpoint or restartpoint (ensures
* CheckpointLock: must be held to do a checkpoint or restartpoint (ensures
* only one checkpointer at a time; currently, with all checkpoints done by
* only one checkpointer at a time; currently, with all checkpoints done by
* the
bgwri
ter, this is just pro forma).
* the
checkpoin
ter, this is just pro forma).
*
*
*----------
*----------
*/
*/
...
@@ -411,7 +411,7 @@ typedef struct XLogCtlData
...
@@ -411,7 +411,7 @@ typedef struct XLogCtlData
/*
/*
* archiveCleanupCommand is read from recovery.conf but needs to be in
* archiveCleanupCommand is read from recovery.conf but needs to be in
* shared memory so that the
bgwri
ter process can access it.
* shared memory so that the
checkpoin
ter process can access it.
*/
*/
char
archiveCleanupCommand
[
MAXPGPATH
];
char
archiveCleanupCommand
[
MAXPGPATH
];
...
@@ -1837,7 +1837,7 @@ XLogWrite(XLogwrtRqst WriteRqst, bool flexible, bool xlog_switch)
...
@@ -1837,7 +1837,7 @@ XLogWrite(XLogwrtRqst WriteRqst, bool flexible, bool xlog_switch)
Write
->
lastSegSwitchTime
=
(
pg_time_t
)
time
(
NULL
);
Write
->
lastSegSwitchTime
=
(
pg_time_t
)
time
(
NULL
);
/*
/*
*
Signal bgwriter to star
t a checkpoint if we've consumed too
*
Reques
t a checkpoint if we've consumed too
* much xlog since the last one. For speed, we first check
* much xlog since the last one. For speed, we first check
* using the local copy of RedoRecPtr, which might be out of
* using the local copy of RedoRecPtr, which might be out of
* date; if it looks like a checkpoint is needed, forcibly
* date; if it looks like a checkpoint is needed, forcibly
...
@@ -2023,8 +2023,8 @@ XLogFlush(XLogRecPtr record)
...
@@ -2023,8 +2023,8 @@ XLogFlush(XLogRecPtr record)
/*
/*
* During REDO, we are reading not writing WAL. Therefore, instead of
* During REDO, we are reading not writing WAL. Therefore, instead of
* trying to flush the WAL, we should update minRecoveryPoint instead. We
* trying to flush the WAL, we should update minRecoveryPoint instead. We
* test XLogInsertAllowed(), not InRecovery, because we need
the bgwri
ter
* test XLogInsertAllowed(), not InRecovery, because we need
checkpoin
ter
* to act this way too, and because when
the bgwriter
tries to write the
* to act this way too, and because when
it
tries to write the
* end-of-recovery checkpoint, it should indeed flush.
* end-of-recovery checkpoint, it should indeed flush.
*/
*/
if
(
!
XLogInsertAllowed
())
if
(
!
XLogInsertAllowed
())
...
@@ -5856,7 +5856,7 @@ pg_is_xlog_replay_paused(PG_FUNCTION_ARGS)
...
@@ -5856,7 +5856,7 @@ pg_is_xlog_replay_paused(PG_FUNCTION_ARGS)
*
*
* We keep this in XLogCtl, not a simple static variable, so that it can be
* We keep this in XLogCtl, not a simple static variable, so that it can be
* seen by processes other than the startup process. Note in particular
* seen by processes other than the startup process. Note in particular
* that CreateRestartPoint is executed in the
bgwri
ter.
* that CreateRestartPoint is executed in the
checkpoin
ter.
*/
*/
static
void
static
void
SetLatestXTime
(
TimestampTz
xtime
)
SetLatestXTime
(
TimestampTz
xtime
)
...
@@ -6464,14 +6464,14 @@ StartupXLOG(void)
...
@@ -6464,14 +6464,14 @@ StartupXLOG(void)
/*
/*
* Let postmaster know we've started redo now, so that it can launch
* Let postmaster know we've started redo now, so that it can launch
*
bgwri
ter to perform restartpoints. We don't bother during crash
*
checkpoin
ter to perform restartpoints. We don't bother during crash
* recovery as restartpoints can only be performed during archive
* recovery as restartpoints can only be performed during archive
* recovery. And we'd like to keep crash recovery simple, to avoid
* recovery. And we'd like to keep crash recovery simple, to avoid
* introducing bugs that could affect you when recovering after crash.
* introducing bugs that could affect you when recovering after crash.
*
*
* After this point, we can no longer assume that we're the only
* After this point, we can no longer assume that we're the only
* process in addition to postmaster! Also, fsync requests are
* process in addition to postmaster! Also, fsync requests are
* subsequently to be handled by the
bgwri
ter, not locally.
* subsequently to be handled by the
checkpoin
ter, not locally.
*/
*/
if
(
InArchiveRecovery
&&
IsUnderPostmaster
)
if
(
InArchiveRecovery
&&
IsUnderPostmaster
)
{
{
...
@@ -7969,8 +7969,8 @@ CheckPointGuts(XLogRecPtr checkPointRedo, int flags)
...
@@ -7969,8 +7969,8 @@ CheckPointGuts(XLogRecPtr checkPointRedo, int flags)
* It must determine whether the checkpoint represents a safe restartpoint or
* It must determine whether the checkpoint represents a safe restartpoint or
* not. If so, the checkpoint record is stashed in shared memory so that
* not. If so, the checkpoint record is stashed in shared memory so that
* CreateRestartPoint can consult it. (Note that the latter function is
* CreateRestartPoint can consult it. (Note that the latter function is
* executed by the
bgwriter, while this one will be executed by the startup
* executed by the
checkpointer, while this one will be executed by the
* process.)
*
startup
process.)
*/
*/
static
void
static
void
RecoveryRestartPoint
(
const
CheckPoint
*
checkPoint
)
RecoveryRestartPoint
(
const
CheckPoint
*
checkPoint
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment