pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Does "pg_ctl stop" wait for archiving to complete?
6+ messages / 4 participants
[nested] [flat]

* Does "pg_ctl stop" wait for archiving to complete?
@ 2014-11-06 20:49  Mitchell Bösecke <mitchell.bosecke@forcorp.com>
  0 siblings, 2 replies; 6+ messages in thread

From: Mitchell Bösecke @ 2014-11-06 20:49 UTC (permalink / raw)
  To: pgsql-admin

Hi,

My understanding is that when postgresql is shutdown it triggers a
checkpoint which triggers the archiving of completed tx logs. Will the
"pg_ctl stop" command wait for archiving to complete or is the act of
archiving completely asynchronous from the shutdown process?

In my case, I WANT the pg_ctl command to hang until all files are archived
because immediately after I issue "pg_ctl stop" I want to be able to
unmount the disk that the archived logs are being copied to.

Thanks for any information,

Mitchell

--
Mitchell Bosecke, B.Sc.
Software Developer

FORCORP
#101, 11710 Kingsway NW
Edmonton , AB, T5G 0X5
www.forcorp.com

(o) 587.410.4067
(f) 780.453.3986

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Does "pg_ctl stop" wait for archiving to complete?
@ 2014-11-06 22:11  Payal Singh <payal@omniti.com>
  parent: Mitchell Bösecke <mitchell.bosecke@forcorp.com>
  1 sibling, 0 replies; 6+ messages in thread

From: Payal Singh @ 2014-11-06 22:11 UTC (permalink / raw)
  To: Mitchell Bösecke <mitchell.bosecke@forcorp.com>; +Cc: pgsql-admin

pg_ctl always shuts down the database cleanly unless used in immediate mode
. So as long as you use -m fast or -m smart (default), your database will
remain consistent (no data loss) and startup without any issues later on.

Payal Singh,
Database Administrator,
OmniTI Computer Consulting Inc.
Phone: 240.646.0770 x 253

On Thu, Nov 6, 2014 at 3:49 PM, Mitchell Bösecke <
mitchell.bosecke@forcorp.com> wrote:

> Hi,
>
> My understanding is that when postgresql is shutdown it triggers a
> checkpoint which triggers the archiving of completed tx logs. Will the
> "pg_ctl stop" command wait for archiving to complete or is the act of
> archiving completely asynchronous from the shutdown process?
>
> In my case, I WANT the pg_ctl command to hang until all files are archived
> because immediately after I issue "pg_ctl stop" I want to be able to
> unmount the disk that the archived logs are being copied to.
>
> Thanks for any information,
>
> Mitchell
>
> --
> Mitchell Bosecke, B.Sc.
> Software Developer
>
> FORCORP
> #101, 11710 Kingsway NW
> Edmonton , AB, T5G 0X5
> www.forcorp.com
>
> (o) 587.410.4067
> (f) 780.453.3986
>

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Does "pg_ctl stop" wait for archiving to complete?
@ 2014-11-07 06:09  Guillaume Lelarge <guillaume@lelarge.info>
  parent: Mitchell Bösecke <mitchell.bosecke@forcorp.com>
  1 sibling, 1 reply; 6+ messages in thread

From: Guillaume Lelarge @ 2014-11-07 06:09 UTC (permalink / raw)
  To: Mitchell Bösecke <mitchell.bosecke@forcorp.com>; +Cc: pgsql-admin

Le 6 nov. 2014 21:59, "Mitchell Bösecke" <mitchell.bosecke@forcorp.com> a
écrit :
>
> Hi,
>
> My understanding is that when postgresql is shutdown it triggers a
checkpoint which triggers the archiving of completed tx logs. Will the
"pg_ctl stop" command wait for archiving to complete or is the act of
archiving completely asynchronous from the shutdown process?
>

Nope, it doesn't wait for archiving.

> In my case, I WANT the pg_ctl command to hang until all files are
archived because immediately after I issue "pg_ctl stop" I want to be able
to unmount the disk that the archived logs are being copied to.
>
> Thanks for any information,
>
> Mitchell
>
> --
> Mitchell Bosecke, B.Sc.
> Software Developer
>
> FORCORP
> #101, 11710 Kingsway NW
> Edmonton , AB, T5G 0X5
> www.forcorp.com
>
> (o) 587.410.4067
> (f) 780.453.3986

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Does "pg_ctl stop" wait for archiving to complete?
@ 2014-12-06 13:26  Bruce Momjian <bruce@momjian.us>
  parent: Guillaume Lelarge <guillaume@lelarge.info>
  0 siblings, 1 reply; 6+ messages in thread

From: Bruce Momjian @ 2014-12-06 13:26 UTC (permalink / raw)
  To: Guillaume Lelarge <guillaume@lelarge.info>; +Cc: Mitchell Bösecke <mitchell.bosecke@forcorp.com>; pgsql-admin

On Fri, Nov  7, 2014 at 07:09:14AM +0100, Guillaume Lelarge wrote:
> Le 6 nov. 2014 21:59, "Mitchell Bösecke" <mitchell.bosecke@forcorp.com> a écrit
> :
> >
> > Hi,
> >
> > My understanding is that when postgresql is shutdown it triggers a checkpoint
> which triggers the archiving of completed tx logs. Will the "pg_ctl stop"
> command wait for archiving to complete or is the act of archiving completely
> asynchronous from the shutdown process?
> >
> 
> Nope, it doesn't wait for archiving.

Uh, are you sure about that?  I thought we did wait during shutdown
unless -W was used in pg_ctl stop.

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +


-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Does "pg_ctl stop" wait for archiving to complete?
@ 2014-12-21 22:14  Guillaume Lelarge <guillaume@lelarge.info>
  parent: Bruce Momjian <bruce@momjian.us>
  0 siblings, 1 reply; 6+ messages in thread

From: Guillaume Lelarge @ 2014-12-21 22:14 UTC (permalink / raw)
  To: Bruce Momjian <bruce@momjian.us>; +Cc: Mitchell Bösecke <mitchell.bosecke@forcorp.com>; pgsql-admin

2014-12-06 14:26 GMT+01:00 Bruce Momjian <bruce@momjian.us>:

> On Fri, Nov  7, 2014 at 07:09:14AM +0100, Guillaume Lelarge wrote:
> > Le 6 nov. 2014 21:59, "Mitchell Bösecke" <mitchell.bosecke@forcorp.com>
> a écrit
> > :
> > >
> > > Hi,
> > >
> > > My understanding is that when postgresql is shutdown it triggers a
> checkpoint
> > which triggers the archiving of completed tx logs. Will the "pg_ctl stop"
> > command wait for archiving to complete or is the act of archiving
> completely
> > asynchronous from the shutdown process?
> > >
> >
> > Nope, it doesn't wait for archiving.
>
> Uh, are you sure about that?  I thought we did wait during shutdown
> unless -W was used in pg_ctl stop.
>
>
Sorry for the very very late reply. I just checked, and you're definitely
right. In fast mode, we wait for the WAL to be archived, unless -W was used.

Sorry about this, and thanks for fixing my mistake.


-- 
Guillaume.
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Does "pg_ctl stop" wait for archiving to complete?
@ 2014-12-22 23:30  Bruce Momjian <bruce@momjian.us>
  parent: Guillaume Lelarge <guillaume@lelarge.info>
  0 siblings, 0 replies; 6+ messages in thread

From: Bruce Momjian @ 2014-12-22 23:30 UTC (permalink / raw)
  To: Guillaume Lelarge <guillaume@lelarge.info>; +Cc: Mitchell Bösecke <mitchell.bosecke@forcorp.com>; pgsql-admin

On Sun, Dec 21, 2014 at 11:14:21PM +0100, Guillaume Lelarge wrote:
> 2014-12-06 14:26 GMT+01:00 Bruce Momjian <bruce@momjian.us>:
> 
>     On Fri, Nov  7, 2014 at 07:09:14AM +0100, Guillaume Lelarge wrote:
>     > Le 6 nov. 2014 21:59, "Mitchell Bösecke" <mitchell.bosecke@forcorp.com> a
>     écrit
>     > :
>     > >
>     > > Hi,
>     > >
>     > > My understanding is that when postgresql is shutdown it triggers a
>     checkpoint
>     > which triggers the archiving of completed tx logs. Will the "pg_ctl stop"
>     > command wait for archiving to complete or is the act of archiving
>     completely
>     > asynchronous from the shutdown process?
>     > >
>     >
>     > Nope, it doesn't wait for archiving.
> 
>     Uh, are you sure about that?  I thought we did wait during shutdown
>     unless -W was used in pg_ctl stop.
> 
> 
> 
> Sorry for the very very late reply. I just checked, and you're definitely
> right. In fast mode, we wait for the WAL to be archived, unless -W was used.
> 
> Sorry about this, and thanks for fixing my mistake.

No problem.  Originally we didn't archive the last WAL file on shutdown
but Simon fixed that a few years ago.

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +


-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2014-12-22 23:30 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2014-11-06 20:49 Does "pg_ctl stop" wait for archiving to complete? Mitchell Bösecke <mitchell.bosecke@forcorp.com>
2014-11-06 22:11 ` Payal Singh <payal@omniti.com>
2014-11-07 06:09 ` Guillaume Lelarge <guillaume@lelarge.info>
2014-12-06 13:26   ` Bruce Momjian <bruce@momjian.us>
2014-12-21 22:14     ` Guillaume Lelarge <guillaume@lelarge.info>
2014-12-22 23:30       ` Bruce Momjian <bruce@momjian.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox