From: Heikki Linnakangas Date: Wed, 28 Jan 2009 16:55:17 +0000 (+0200) Subject: Fix issues pointed out by Fujii Masao. X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=3bac478d75c850e079a6fdb03b10e2d9d9f44017;p=users%2Fsimon%2Fpostgres.git Fix issues pointed out by Fujii Masao. --- diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 30fea49397..d9972e8fab 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -2148,8 +2148,7 @@ XLogFileInit(uint32 log, uint32 seg, unlink(tmppath); } - XLogFileName(tmppath, ThisTimeLineID, log, seg); - elog(DEBUG2, "done creating and filling new WAL file %s", tmppath); + elog(DEBUG2, "done creating and filling new WAL file"); /* Set flag to tell caller there was no existent file */ *use_existent = false; diff --git a/src/backend/bootstrap/bootstrap.c b/src/backend/bootstrap/bootstrap.c index 431a95fdf2..ad277a361e 100644 --- a/src/backend/bootstrap/bootstrap.c +++ b/src/backend/bootstrap/bootstrap.c @@ -423,7 +423,7 @@ AuxiliaryProcessMain(int argc, char *argv[]) case BgWriterProcess: /* don't set signals, bgwriter has its own agenda */ - InitXLOGAccess(); + /* don't call InitXLOGAccess(), bgwriter does it itself */ BackgroundWriterMain(); proc_exit(1); /* should never return */ diff --git a/src/backend/postmaster/bgwriter.c b/src/backend/postmaster/bgwriter.c index 428a440b03..4f1b6f604c 100644 --- a/src/backend/postmaster/bgwriter.c +++ b/src/backend/postmaster/bgwriter.c @@ -448,12 +448,13 @@ BackgroundWriterMain(void) * whether to perform a checkpoint or not, to be sure that we * perform a real checkpoint and not a restartpoint, if someone * (like the startup process!) requested a checkpoint immediately - * after exiting recovery. + * after exiting recovery. And we must have the right TimeLineID + * when we perform a checkpoint. */ if (BgWriterRecoveryMode && !IsRecoveryProcessingMode()) { elog(DEBUG1, "bgwriter changing from recovery to normal mode"); - + InitXLOGAccess(); BgWriterRecoveryMode = false; } @@ -550,7 +551,7 @@ CheckArchiveTimeout(void) pg_time_t now; pg_time_t last_time; - if (XLogArchiveTimeout <= 0 || !IsRecoveryProcessingMode()) + if (XLogArchiveTimeout <= 0 || IsRecoveryProcessingMode()) return; now = (pg_time_t) time(NULL);