Re: [HACKERS] Potential data loss of 2PC files - Mailing list pgsql-hackers

From Teodor Sigaev
Subject Re: [HACKERS] Potential data loss of 2PC files
Date
Msg-id 1ba0a71a-0821-5003-8b8c-5bd7c8abc3e7@sigaev.ru
Whole thread Raw
In response to Re: [HACKERS] Potential data loss of 2PC files  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: [HACKERS] Potential data loss of 2PC files  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
>>> If that can happen, don't we have the same problem in many other places?
>>> Like, all the SLRUs? They don't fsync the directory either.
>> Right, pg_commit_ts and pg_clog enter in this category.
>
> Implemented as attached.
>
>>> Is unlink() guaranteed to be durable, without fsyncing the directory? If
>>> not, then we need to fsync() the directory even if there are no files in it
>>> at the moment, because some might've been removed earlier in the checkpoint
>>> cycle.

What is protection if pg crashes after unlimk() but before fsync()? Right, it's 
rather small window for such scenario, but isn't better to  have another 
protection? Like WAL-logging of WAL segment removing...

-- 
Teodor Sigaev                                   E-mail: teodor@sigaev.ru
  WWW: http://www.sigaev.ru/
 



pgsql-hackers by date:

Previous
From: David Steele
Date:
Subject: Re: [HACKERS] [PATCH] kNN for SP-GiST
Next
From: Andres Freund
Date:
Subject: Re: [HACKERS] Patch: Write Amplification Reduction Method (WARM)