aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Riggs <simon@2ndQuadrant.com>2012-06-01 08:25:17 +0100
committerSimon Riggs <simon@2ndQuadrant.com>2012-06-01 08:25:17 +0100
commita297d64d9223f6bd9c495ff5726a3c99080c2a4a (patch)
treebe94f622a6e4a5282ee6c0667d32e6b8b559239d /src
parent1ec6a2bbc966a05acf10a6753d8ec7db83f43f4c (diff)
downloadpostgresql-a297d64d9223f6bd9c495ff5726a3c99080c2a4a.tar.gz
postgresql-a297d64d9223f6bd9c495ff5726a3c99080c2a4a.zip
Checkpointer starts before bgwriter to avoid missing fsync requests.
Noted while testing Hot Standby startup.
Diffstat (limited to 'src')
-rw-r--r--src/backend/postmaster/postmaster.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index e400f0a8e15..830a83f60e0 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -1378,10 +1378,10 @@ ServerLoop(void)
if (pmState == PM_RUN || pmState == PM_RECOVERY ||
pmState == PM_HOT_STANDBY)
{
- if (BgWriterPID == 0)
- BgWriterPID = StartBackgroundWriter();
if (CheckpointerPID == 0)
CheckpointerPID = StartCheckpointer();
+ if (BgWriterPID == 0)
+ BgWriterPID = StartBackgroundWriter();
}
/*
@@ -2372,10 +2372,10 @@ reaper(SIGNAL_ARGS)
* when we entered consistent recovery state. It doesn't matter
* if this fails, we'll just try again later.
*/
- if (BgWriterPID == 0)
- BgWriterPID = StartBackgroundWriter();
if (CheckpointerPID == 0)
CheckpointerPID = StartCheckpointer();
+ if (BgWriterPID == 0)
+ BgWriterPID = StartBackgroundWriter();
if (WalWriterPID == 0)
WalWriterPID = StartWalWriter();
@@ -4239,10 +4239,10 @@ sigusr1_handler(SIGNAL_ARGS)
* Crank up the background tasks. It doesn't matter if this fails,
* we'll just try again later.
*/
- Assert(BgWriterPID == 0);
- BgWriterPID = StartBackgroundWriter();
Assert(CheckpointerPID == 0);
CheckpointerPID = StartCheckpointer();
+ Assert(BgWriterPID == 0);
+ BgWriterPID = StartBackgroundWriter();
pmState = PM_RECOVERY;
}