Re: Bug in slot.c and are replication slots ever used at Window? - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Bug in slot.c and are replication slots ever used at Window?
Date
Msg-id 20180830182731.GE15446@paquier.xyz
Whole thread Raw
In response to Bug in slot.c and are replication slots ever used at Window?  (Konstantin Knizhnik <k.knizhnik@postgrespro.ru>)
Responses Re: Bug in slot.c and are replication slots ever used at Window?
List pgsql-hackers
On Thu, Aug 30, 2018 at 11:00:43AM +0300, Konstantin Knizhnik wrote:
> So if "isdir" is true (and it is true in this case), it sets O_RDONLY
> flag.  Then fsync_fname successfully opens slot file in readonly mode
> and calls fsync() which at windows is substituted with _commit() which
> in turn is wrapper for FlushFileBuffers.

It seems to me that you are right here, "path" points to
pg_replslot/$SLOTNAME/state which is a file so the fsync is incorrect.
I am not sure that we'd want to publish fsync_parent_path out of fd.c
though, so perhaps we could just save the slot path in a different
variable and use it?
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Online verification of checksums
Next
From: Alexander Kukushkin
Date:
Subject: Re: BUG #15346: Replica fails to start after the crash