Re: Clean shutdown and warm standby - Mailing list pgsql-hackers

From Andreas Pflug
Subject Re: Clean shutdown and warm standby
Date
Msg-id 49F626F5.9060200@pse-consulting.de
Whole thread Raw
In response to Re: Clean shutdown and warm standby  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Responses Re: Clean shutdown and warm standby  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
Heikki Linnakangas wrote:
>
> No, no crash is involved. Just a normal server shutdown and start:
>
> 1. Server shutdown is initiated
> 2. A shutdown checkpoint is recorded at XLOG point 1234, redo ptr is 
> also 1234.
> 3. A XLOG_SWITCH record is written at 1235, right after the checkpoint 
> record.
> 4. The last round of archiving is done. The partial WAL file 
> containing the checkpoint and XLOG_SWITCH record is archived.
> 5. Postmaster exits.
>
> 6. Postmaster is started again. Since the system was shut down 
> cleanly, no WAL recovery is done. The WAL insert pointer is 
> initialized to right after the redo pointer, location 1235, which is 
> also the location of the XLOG_SWITCH record.
> 7. The next WAL record written will be written at 1235, overwriting 
> the XLOG_SWITCH record.
> 8. When the WAL file fills up, the system will try to archive the same 
> WAL file again, this time with additional WAL records that after the 
> checkpoint record. 

So to get this down to a solution, it appears to be correct to execute 
the RequestXLogSwitch right before CreateCheckPoint?


Regards,
Andreas



pgsql-hackers by date:

Previous
From: Dimitri Fontaine
Date:
Subject: Re: idea: global temp tables
Next
From: "Kevin Grittner"
Date:
Subject: Re: idea: global temp tables