Re: pg_start_backup('label',true) why do I need 2nd parameter?

From: Bill Moran <wmoran(at)potentialtech(dot)com>
To: AI Rumman <rummandba(at)gmail(dot)com>
Cc: pgsql-general General <pgsql-general(at)postgresql(dot)org>
Subject: Re: pg_start_backup('label',true) why do I need 2nd parameter?
Date: 2013-11-06 02:44:07
Message-ID: 20131105214407.9f7a6c0f6fd1c48f21ed4418@potentialtech.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 5 Nov 2013 15:30:19 -0800 AI Rumman <rummandba(at)gmail(dot)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(at)potentialtech(dot)com>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Johnston 2013-11-06 03:27:52 Re: pg_start_backup('label',true) why do I need 2nd parameter?
Previous Message David Johnston 2013-11-06 00:15:44 Re: pg_start_backup('label',true) why do I need 2nd parameter?