mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-10-01 20:51:21 +02:00
Now that streaming replication switches between streaming mode and
restoring from archive, the last WAL segment is not necessarily open at the end of recovery. Fix assertion that assumed that. Fujii Masao, fixing the assertion failure reported by Martin Pihlak.
This commit is contained in:
parent
76b6ee3f38
commit
161d9d51b3
@ -7,7 +7,7 @@
|
|||||||
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.369 2010/02/08 09:08:51 heikki Exp $
|
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.370 2010/02/10 08:25:25 heikki Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -5085,16 +5085,14 @@ exitArchiveRecovery(TimeLineID endTLI, uint32 endLogId, uint32 endLogSeg)
|
|||||||
UpdateMinRecoveryPoint(InvalidXLogRecPtr, true);
|
UpdateMinRecoveryPoint(InvalidXLogRecPtr, true);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We should have the ending log segment currently open. Verify, and then
|
* If the ending log segment is still open, close it (to avoid
|
||||||
* close it (to avoid problems on Windows with trying to rename or delete
|
* problems on Windows with trying to rename or delete an open file).
|
||||||
* an open file).
|
|
||||||
*/
|
*/
|
||||||
Assert(readFile >= 0);
|
if (readFile >= 0)
|
||||||
Assert(readId == endLogId);
|
{
|
||||||
Assert(readSeg == endLogSeg);
|
|
||||||
|
|
||||||
close(readFile);
|
close(readFile);
|
||||||
readFile = -1;
|
readFile = -1;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the segment was fetched from archival storage, we want to replace
|
* If the segment was fetched from archival storage, we want to replace
|
||||||
|
Loading…
Reference in New Issue
Block a user