Re: [HACKERS] Reversed sync check in pg_receivewal - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: [HACKERS] Reversed sync check in pg_receivewal
Date
Msg-id CAB7nPqQbV4MBV-0uzzjQPz743WHgiaFGYXjAK_Rq=skYCkZLpw@mail.gmail.com
Whole thread Raw
In response to [HACKERS] Reversed sync check in pg_receivewal  (Magnus Hagander <magnus@hagander.net>)
List pgsql-hackers
On Tue, Apr 11, 2017 at 9:41 PM, Magnus Hagander <magnus@hagander.net> wrote:
> This bug seems to have snuck in there with the introduction of walmethods.
> AFAICT we are testing the result of sync() backwards, so whenever a partial
> segment exists for pg_receivewal, it will fail. It will then unlink the
> file, so when it retries 5 seconds later it works.
>
> It also doesn't log the failure. Oops.
>
> Attached patch reverses the check, and adds a failure message. I'd
> appreciate a quick review in case I have the logic backwards in my head...

This has been fat-fingered in 56c7d8d4, and looking around I am not
seeing similar mistakes. Thanks for the fix.
-- 
Michael



pgsql-hackers by date:

Previous
From: Álvaro Hernández Tortosa
Date:
Subject: Re: [HACKERS] Some thoughts about SCRAM implementation
Next
From: Aleksander Alekseev
Date:
Subject: Re: [HACKERS] Reversed sync check in pg_receivewal