Re: Patch: add recovery_timeout option to control timeout of restore_command nonzero status code

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Alexey Vasiliev <leopard_ne(at)inbox(dot)ru>, Fabrízio Mello <fabriziomello(at)gmail(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: add recovery_timeout option to control timeout of restore_command nonzero status code
Date: 2015-01-19 08:16:11
Message-ID: CAB7nPqSbanVp6kFYnKXkqREJ_x5iuq4RSH9A6s-KuMk3w5VU0A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jan 19, 2015 at 4:10 PM, Michael Paquier
<michael(dot)paquier(at)gmail(dot)com> wrote:
> On Sat, Jan 17, 2015 at 2:44 AM, Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
>> Not this patch's fault, but I'm getting a bit tired seeing the above open
>> coded. How about adding a function that does the sleeping based on a
>> timestamptz and a ms interval?
> You mean in plugins, right? I don't recall seeing similar patterns in
> other code paths of backend. But I think that we can use something
> like that in timestamp.c then because we need to leverage that between
> two timestamps, the last failure and now():
> TimestampSleepDifference(start_time, stop_time, internal_ms);
> Perhaps you have something else in mind?
>
> Attached is an updated patch.
Actually I came with better than last patch by using a boolean flag as
return value of TimestampSleepDifference and use
TimestampDifferenceExceeds directly inside it.
Regards,
--
Michael

Attachment Content-Type Size
20150119_wal_avail_check_v2.patch text/x-diff 7.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dean Rasheed 2015-01-19 08:21:35 Re: INSERT ... ON CONFLICT UPDATE and RLS
Previous Message Etsuro Fujita 2015-01-19 08:10:32 Re: EvalPlanQual behaves oddly for FDW queries involving system columns