Reversed sync check in pg_receivewal

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Reversed sync check in pg_receivewal
Date: 2017-04-11 12:41:15
Message-ID: CABUevEyTV2gMpfnraS=uPSX+JXRwSR+1Jt5DLYb1bcQ8DEVS+A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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...

--
Magnus Hagander
Me: https://www.hagander.net/ <http://www.hagander.net/>
Work: https://www.redpill-linpro.com/ <http://www.redpill-linpro.com/>

Attachment Content-Type Size
receivelog_sync.patch text/x-patch 640 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2017-04-11 12:49:44 Re: [pgsql-www] Small issue in online devel documentation build
Previous Message Simon Riggs 2017-04-11 12:38:40 Re: [PATCH v1] Add and report the new "in_hot_standby" GUC pseudo-variable.