|
7 | 7 | * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
|
8 | 8 | * Portions Copyright (c) 1994, Regents of the University of California
|
9 | 9 | *
|
10 |
| - * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.340 2009/05/15 15:56:39 tgl Exp $ |
| 10 | + * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.341 2009/05/28 11:02:16 heikki Exp $ |
11 | 11 | *
|
12 | 12 | *-------------------------------------------------------------------------
|
13 | 13 | */
|
@@ -6085,7 +6085,18 @@ ShutdownXLOG(int code, Datum arg)
|
6085 | 6085 | if (RecoveryInProgress())
|
6086 | 6086 | CreateRestartPoint(CHECKPOINT_IS_SHUTDOWN |CHECKPOINT_IMMEDIATE);
|
6087 | 6087 | else
|
| 6088 | +{ |
| 6089 | +/* |
| 6090 | + * If archiving is enabled, rotate the last XLOG file so that all the |
| 6091 | + * remaining records are archived (postmaster wakes up the archiver |
| 6092 | + * process one more time at the end of shutdown). The checkpoint |
| 6093 | + * record will go to the next XLOG file and won't be archived (yet). |
| 6094 | + */ |
| 6095 | +if (XLogArchivingActive()&&XLogArchiveCommandSet()) |
| 6096 | +RequestXLogSwitch(); |
| 6097 | + |
6088 | 6098 | CreateCheckPoint(CHECKPOINT_IS_SHUTDOWN |CHECKPOINT_IMMEDIATE);
|
| 6099 | +} |
6089 | 6100 | ShutdownCLOG();
|
6090 | 6101 | ShutdownSUBTRANS();
|
6091 | 6102 | ShutdownMultiXact();
|
|