Re: PATCH: Make pg_stop_backup() archive wait optional

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: David Steele <david(at)pgmasters(dot)net>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PATCH: Make pg_stop_backup() archive wait optional
Date: 2017-03-04 06:58:49
Message-ID: CA+TgmobfcE=fVoqhgWr6SFuhARdo6DY2Yz27eOevJnXr0ch1Lw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Mar 1, 2017 at 9:07 AM, David Steele <david(at)pgmasters(dot)net> wrote:
> On 2/28/17 10:22 PM, Robert Haas wrote:
>> On Tue, Feb 28, 2017 at 6:22 AM, David Steele <david(at)pgmasters(dot)net> wrote:
>>>>> I'm not sure that's the case. It seems like it should lock just as
>>>>> multiple backends would now. One process would succeed and the others
>>>>> would error. Maybe I'm missing something?
>>>>
>>>> Hm, any errors happening in the workers would be reported to the
>>>> leader, meaning that even if one worker succeeded to run
>>>> pg_start_backup() it would be reported as an error at the end to the
>>>> client, no? By marking the exclusive function restricted we get sure
>>>> that it is just the leader that fails or succeeds.
>>>
>>> Good point, and it strengthens the argument beyond, "it just seems right."
>>
>> I think the argument should be based on whether or not the function
>> depends on backend-private state that will not be synchronized.
>> That's the definition of what makes something parallel-restricted or
>> not.
>
> Absolutely. Yesterday was a long day so I may have (perhaps) become a
> bit flippant.
>
>> It looks like pg_start_backup() and pg_stop_backup() depend on the
>> backend-private global variable nonexclusive_backup_running, so they
>> should be parallel-restricted.
>
> Agreed.

How about a separately-committable patch that just does that, and then
a main patch that applies on top of it?

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabien COELHO 2017-03-04 07:00:56 Re: [pgsql-www] Small issue in online devel documentation build
Previous Message Robert Haas 2017-03-04 06:56:12 Re: GSoC 2017