Re: archive status ".ready" files may be created too early

Поиск
Список
Период
Сортировка
Искать
От
Kyotaro Horiguchi
Тема
Re: archive status ".ready" files may be created too early
Дата
Msg-id
20191218.173658.4136447812388306.horikyota.ntt@gmail.com
Ответ на
Список
Дерево обсуждения
archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Re: archive status ".ready" files may be created too early Alvaro Herrera <alvherre@2ndquadrant.com>
Re: archive status ".ready" files may be created too early Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Re: archive status ".ready" files may be created too early Fujii Masao <masao.fujii@gmail.com>
Re: archive status ".ready" files may be created too early Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
RE: archive status ".ready" files may be created too early "matsumura.ryo@fujitsu.com" <matsumura.ryo@fujitsu.com>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
RE: archive status ".ready" files may be created too early "matsumura.ryo@fujitsu.com" <matsumura.ryo@fujitsu.com>
Re: archive status ".ready" files may be created too early Kyotaro Horiguchi <horikyota.ntt@gmail.com>
RE: archive status ".ready" files may be created too early "matsumura.ryo@fujitsu.com" <matsumura.ryo@fujitsu.com>
Re: archive status ".ready" files may be created too early Kyotaro Horiguchi <horikyota.ntt@gmail.com>
RE: archive status ".ready" files may be created too early "matsumura.ryo@fujitsu.com" <matsumura.ryo@fujitsu.com>
Re: archive status ".ready" files may be created too early Kyotaro Horiguchi <horikyota.ntt@gmail.com>
RE: archive status ".ready" files may be created too early "matsumura.ryo@fujitsu.com" <matsumura.ryo@fujitsu.com>
Re: archive status ".ready" files may be created too early Michael Paquier <michael@paquier.xyz>
Re: archive status ".ready" files may be created too early Heikki Linnakangas <hlinnaka@iki.fi>
Re: archive status ".ready" files may be created too early Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Re: archive status ".ready" files may be created too early Anastasia Lubennikova <a.lubennikova@postgrespro.ru>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Re: archive status ".ready" files may be created too early Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Re: archive status ".ready" files may be created too early Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Re: archive status ".ready" files may be created too early Andrey Borodin <x4mmm@yandex-team.ru>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: archive status ".ready" files may be created too early Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Re: archive status ".ready" files may be created too early Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early "alvherre@alvh.no-ip.org" <alvherre@alvh.no-ip.org>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early "alvherre@alvh.no-ip.org" <alvherre@alvh.no-ip.org>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early "alvherre@alvh.no-ip.org" <alvherre@alvh.no-ip.org>
Re: archive status ".ready" files may be created too early "alvherre@alvh.no-ip.org" <alvherre@alvh.no-ip.org>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early "alvherre@alvh.no-ip.org" <alvherre@alvh.no-ip.org>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early "alvherre@alvh.no-ip.org" <alvherre@alvh.no-ip.org>
Re: archive status ".ready" files may be created too early "alvherre@alvh.no-ip.org" <alvherre@alvh.no-ip.org>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early "alvherre@alvh.no-ip.org" <alvherre@alvh.no-ip.org>
Re: archive status ".ready" files may be created too early "alvherre@alvh.no-ip.org" <alvherre@alvh.no-ip.org>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early "alvherre@alvh.no-ip.org" <alvherre@alvh.no-ip.org>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early "alvherre@alvh.no-ip.org" <alvherre@alvh.no-ip.org>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early "alvherre@alvh.no-ip.org" <alvherre@alvh.no-ip.org>
Re: archive status ".ready" files may be created too early "alvherre@alvh.no-ip.org" <alvherre@alvh.no-ip.org>
Re: archive status ".ready" files may be created too early Robert Haas <robertmhaas@gmail.com>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early "alvherre@alvh.no-ip.org" <alvherre@alvh.no-ip.org>
Re: archive status ".ready" files may be created too early Robert Haas <robertmhaas@gmail.com>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early "alvherre@alvh.no-ip.org" <alvherre@alvh.no-ip.org>
Re: archive status ".ready" files may be created too early "alvherre@alvh.no-ip.org" <alvherre@alvh.no-ip.org>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early "alvherre@alvh.no-ip.org" <alvherre@alvh.no-ip.org>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early "alvherre@alvh.no-ip.org" <alvherre@alvh.no-ip.org>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early "alvherre@alvh.no-ip.org" <alvherre@alvh.no-ip.org>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early "alvherre@alvh.no-ip.org" <alvherre@alvh.no-ip.org>
Re: archive status ".ready" files may be created too early "alvherre@alvh.no-ip.org" <alvherre@alvh.no-ip.org>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early "alvherre@alvh.no-ip.org" <alvherre@alvh.no-ip.org>
Re: archive status ".ready" files may be created too early Andres Freund <andres@anarazel.de>
Re: archive status ".ready" files may be created too early "alvherre@alvh.no-ip.org" <alvherre@alvh.no-ip.org>
Re: archive status ".ready" files may be created too early Andres Freund <andres@anarazel.de>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early Andres Freund <andres@anarazel.de>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early Andres Freund <andres@anarazel.de>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early Andres Freund <andres@anarazel.de>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early Andres Freund <andres@anarazel.de>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early Andres Freund <andres@anarazel.de>
Re: archive status ".ready" files may be created too early "alvherre@alvh.no-ip.org" <alvherre@alvh.no-ip.org>
Re: archive status ".ready" files may be created too early Michael Paquier <michael@paquier.xyz>
Re: archive status ".ready" files may be created too early "alvherre@alvh.no-ip.org" <alvherre@alvh.no-ip.org>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early "alvherre@alvh.no-ip.org" <alvherre@alvh.no-ip.org>
Re: archive status ".ready" files may be created too early Fujii Masao <masao.fujii@oss.nttdata.com>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early Robert Haas <robertmhaas@gmail.com>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early Robert Haas <robertmhaas@gmail.com>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early Andrey Borodin <x4mmm@yandex-team.ru>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early "Bossart, Nathan" <bossartn@amazon.com>
Re: archive status ".ready" files may be created too early Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Hello.

At Wed, 18 Dec 2019 14:10:04 +0900, Fujii Masao  wrote in 
> On Fri, Dec 13, 2019 at 7:50 AM Bossart, Nathan  wrote:
> >
> > Hi hackers,
> >
> > I believe I've uncovered a bug that may cause archive status ".ready"
> > files to be created too early, which in turn may cause an incorrect
> > version of the corresponding WAL segment to be archived.
> >
> > The crux of the issue seems to be that XLogWrite() does not wait for
> > the entire record to be written to disk before creating the ".ready"
> > file.  Instead, it just waits for the last page of the segment to be
> > written before notifying the archiver.  If PostgreSQL crashes before
> > it is able to write the rest of the record, it will end up reusing the
> > ".ready" segment at the end of crash recovery.  In the meantime, the
> > archiver process may have already processed the old version of the
> > segment.
> 
> Maybe I'm missing something... But since XLogWrite() seems to
> call issue_xlog_fsync() before XLogArchiveNotifySeg(), ISTM that
> this trouble shouldn't happen. No?

The trouble happens after the synced file is archived.  If the last
record in the arcvhied segment was the first half of a continuation
record and crash before writing the last half, crash recovery stops
just before the first half and different record can be overwitten. As
the result the archived version of the segment becomes rotten.

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center


В списке pgsql-hackers по дате отправления
От: Peter Eisentraut
Дата:
Сообщение: Re: Add .editorconfig
От: Juan José Santamaría Flecha
Дата:
FAQ