Re: pg_start_backup('label',true) why do I need 2nd parameter? - Mailing list pgsql-general

From Bill Moran
Subject Re: pg_start_backup('label',true) why do I need 2nd parameter?
Date
Msg-id 20131105214407.9f7a6c0f6fd1c48f21ed4418@potentialtech.com
Whole thread Raw
In response to pg_start_backup('label',true) why do I need 2nd parameter?  (AI Rumman <rummandba@gmail.com>)
Responses Re: pg_start_backup('label',true) why do I need 2nd parameter?
List pgsql-general
On Tue, 5 Nov 2013 15:30:19 -0800 AI Rumman <rummandba@gmail.com> wrote:

> Hi all,
>
> A few days back, I faced a problem where I *pg_start_backup('label') *was
> hang in the server forever.
> I stopped the process and then used *pg_start_backup('label',true) *and  it
> worked.
>
> Now I am trying to investigate why I need to use true as second parameter
> and read the doc
> "There is an optional second parameter of type boolean. If true, it
> specifies executing pg_start_backup as quickly as possible. This forces an
> immediate checkpoint which will cause a spike in I/O operations, slowing
> any concurrently executing queries."

To add to what David said in his email ... essentially with the second
parameter at false (which is the same as omitting it) you are telling
the system to not interfere with other concurrently running processes
and take as much time as necessary to prep the system without interfering.
How long that takes is a factor of other settings (as David mentioned) and
also depedent on what other transactions may be running.

With the second parameter at true, you're telling Postgres to execute the
start backup as fast as possible and if other queries are temporarily
slow or unresponsive while it's getting there, that's OK.

As far as exactly replicating the scenerio, you would need to know what
else was running on the server at the time to exactly replicate it.

>
> I tried to regenerate the scenario where  *pg_start_backup('label')
> *hanged and
> I failed.
> Any idea, how can I regenerate that issue to investigate.
>
> I am using Postgresql 9.2.
>
> Thanks.


--
Bill Moran <wmoran@potentialtech.com>


pgsql-general by date:

Previous
From: David Johnston
Date:
Subject: Re: pg_start_backup('label',true) why do I need 2nd parameter?
Next
From: David Johnston
Date:
Subject: Re: pg_start_backup('label',true) why do I need 2nd parameter?