Re: Clean shutdown and warm standby
От | Fujii Masao |
---|---|
Тема | Re: Clean shutdown and warm standby |
Дата | |
Msg-id | 3f0b79eb0904270525o1f432102v4834430e8453408a@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Clean shutdown and warm standby (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>) |
Ответы |
Re: Clean shutdown and warm standby
|
Список | pgsql-hackers |
Hi, On Mon, Apr 27, 2009 at 8:43 PM, Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> wrote: > Fujii Masao wrote: >> >> On Fri, Apr 24, 2009 at 3:20 PM, Heikki Linnakangas >> <heikki.linnakangas@enterprisedb.com> wrote: >>> >>> It's not safe to write WAL after the checkpoint, as RequestXLogSwitch() >>> does. After restart, the system will start inserting WAL from the >>> checkpoint >>> redo point, which is just before the XLOG_SWITCH record, and will >>> overwrite >>> it. >> >> Since, in this case, the WAL file including XLOG_SWITCH exists >> in archive, I don't think that it's unsafe, i.e. XLOG_SWITCH would >> be treated as the last applied record and not be overwritten. WAL >> records would start to be inserted from the subsequent file (with >> new timeline). > > It will be overwritten in a normal non-archive-recovery startup. Hmm, you mean the case where the system crashes after inserting XLOG_SWITCH and before archiving the WAL file containing it? Okey, though it seems unlikely, XLOG_SWITCH would be overwritten by subsequent non-archive-recovery. I just have an idea; when the last applied WAL file has archive_status, the system starts WAL insertion from the next file after recovery. But, there is still race condition that the system may crash after XLOG_SWITCH is written (fsynced) and before .ready file is created. Regards, -- Fujii Masao NIPPON TELEGRAPH AND TELEPHONE CORPORATION NTT Open Source Software Center
В списке pgsql-hackers по дате отправления: