Re: [HACKERS] Potential data loss of 2PC files

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: [HACKERS] Potential data loss of 2PC files
Дата
Msg-id CAB7nPqQu28cc9oEUppa1i6GEZ8-hXOXKfrm8BpnvbX2Y5r8aag@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] Potential data loss of 2PC files  (Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>)
Ответы Re: [HACKERS] Potential data loss of 2PC files  (Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>)
Список pgsql-hackers
On Tue, Jan 3, 2017 at 3:32 PM, Ashutosh Bapat
<ashutosh.bapat@enterprisedb.com> wrote:
> I am wondering what happens if a 2PC file gets created, at the time of
> checkpoint we flush the pg_twophase directory, then the file gets
> removed. Do we need to flush the directory to ensure that the removal
> persists? Whatever material I look for fsync() on directory, it gives
> examples of file creation, not that of deleting a file. If we want to
> persist the removal, probably we have to flush pg_twophase always or
> add code to track whether any activity happened in pg_twophase between
> two checkpoints. The later seems complication not worth the benefit.

There is already the delay checkpoint machinery to cover timing
problems here. Have a look for example at EndPrepare()@twophase.c.

> I guess, it's hard to construct a case to reproduce the issue
> described in your first mail. But still checking if you have any
> reproduction. May be we could use similar reproduction to test the
> deletion of two phase file.

Not really. You can just do the test on a VM (one transaction
generating a 2PC file, followed by a checkpoint), then kill-9 its
parent instance. That's radical to emulate the power loss. I do that
on macos with VMware Fusion.
-- 
Michael



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

Предыдущее
От: valeriof
Дата:
Сообщение: [HACKERS] Logical decoding - filtering tables
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: [HACKERS] Logical decoding - filtering tables