Re: BUG: *FF WALs under 9.2 (WAS: .ready files appearing on slaves)

Поиск
Список
Период
Сортировка
От Fujii Masao
Тема Re: BUG: *FF WALs under 9.2 (WAS: .ready files appearing on slaves)
Дата
Msg-id CAHGQGwHb9AgzqvpJf1_OkeDi7yUQ7fxHEQwS5iCytMi_ANwn1Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG: *FF WALs under 9.2 (WAS: .ready files appearing on slaves)  (Michael Paquier <michael.paquier@gmail.com>)
Ответы Re: BUG: *FF WALs under 9.2 (WAS: .ready files appearing on slaves)
Список pgsql-hackers
On Mon, Oct 20, 2014 at 3:26 PM, Michael Paquier
<michael.paquier@gmail.com> wrote:
> On Fri, Oct 17, 2014 at 10:37 PM, Michael Paquier
> <michael.paquier@gmail.com> wrote:
>>
>> On Fri, Oct 17, 2014 at 9:23 PM, Fujii Masao <masao.fujii@gmail.com> wrote:
>>>
>>> In this case, the patch seems to make the restartpoint recycle even WAL files
>>> which have .ready files and will have to be archived later. Thought?
>>
>> The real problem currently is that it is possible to have a segment file not marked as .done during recovery when
streamconnection is abruptly cut when this segment is switched, marking it as .ready in archive_status and simply
lettingthis segment in pg_xlog because it will neither be recycled nor removed. I have not been able to look much at
thiscode these days, so I am not sure how invasive it would be in back-branches, but perhaps we should try to improve
codesuch as when a segment file is switched and connection to the is cut, we guarantee that this file is completed and
markedas .done. 
>
> I have spent more time on that, with a bit more of underground work...
> First, the problem can be reproduced most of the time by running this
> simple command:
> psql -c 'select pg_switch_xlog()'; pg_ctl restart -m immediate

What about fixing this problem directly? That is, we can make walreceiver
check whether the end of last received WAL data is the end of current WAL file
or not, and then close the WAL file and create .done file if the test is true.

This is not a perfect solution. If the standby crashes during very
short interval
(i.e., after closing the WAL file and before creating .done file), the problem
would happen again. But it can really rarely happen, so I don't think that it's
worth fixing the corner case at least in back-branches. Of course, we can
find out the "perfect" solution for the master, though.

Regards,

--
Fujii Masao



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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: Function array_agg(array)
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: [PATCH] add ssl_protocols configuration option