Re: Proposed doc-patch: Identifying the Current WAL file

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Proposed doc-patch: Identifying the Current WAL file
Дата
Msg-id 9932.1145030835@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Proposed doc-patch: Identifying the Current WAL file  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: Proposed doc-patch: Identifying the Current WAL file  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-docs
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Richard Huxton wrote:
>> To identify the current, partially-filled WAL segment, sort first by
>> mtime and second by file name. That is, take the latest mtime among the
>> properly-named files, breaking ties by taking the higher filename.

> I am confused by this.  Why do both mtime and file name need to be
> checked?

Because recycled WAL segments are renamed to have higher file names than
the currently-in-use segment.  So you can't depend on file name first.
However, shortly after a segment switch two WAL segments could have the
same mtime (to within whatever the mtime granularity is, typ. 1 second).

The proposed rule should be OK as long as checkpoints (and ensuing
renames) can't occur oftener than the mtime granularity.  If you're
checkpointing more than once a second, well, you need help ...

            regards, tom lane

В списке pgsql-docs по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Proposed doc-patch: Identifying the Current WAL file
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Proposed doc-patch: Identifying the Current WAL file