Fix issues pointed out by Fujii Masao.
authorHeikki Linnakangas <heikki@enterprisedb.com>
Wed, 28 Jan 2009 16:55:17 +0000 (18:55 +0200)
committerHeikki Linnakangas <heikki@enterprisedb.com>
Wed, 28 Jan 2009 16:56:03 +0000 (18:56 +0200)
src/backend/access/transam/xlog.c
src/backend/bootstrap/bootstrap.c
src/backend/postmaster/bgwriter.c

index 30fea493979db8b6ea065960c17320d20fd35e31..d9972e8fab39d05cdb42bce4723062fa24c54cea 100644 (file)
@@ -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;
index 431a95fdf2e04a1f0e2b34f94663acaf37f49d66..ad277a361e99f8ad89071ce8f6dac20aebe86ee6 100644 (file)
@@ -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 */
 
index 428a440b03914431c0e54e823919356d20aed26c..4f1b6f604c650ba0311707a9f0a4284e91cd80fd 100644 (file)
@@ -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);