Skip site navigation (1) Skip section navigation (2)

Re: pg_ctl stop -m immediate on the primary serverinflates sequences

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Boszormenyi Zoltan <zb(at)cybertec(dot)at>
Cc: Bernd Helmle <mailings(at)oopsware(dot)de>, pgsql-hackers(at)postgresql(dot)org,Hans-Juergen Schoenig <hs(at)cybertec(dot)at>
Subject: Re: pg_ctl stop -m immediate on the primary serverinflates sequences
Date: 2010-04-10 20:02:15
Message-ID: 20100410200215.GC6944@svana.org (view raw or flat)
Thread:
Lists: pgsql-hackers
On Sat, Apr 10, 2010 at 02:36:41PM +0200, Boszormenyi Zoltan wrote:
> >> The above is quite reproducable, "pg_ctl stop -m immediate"
> >> "usually" inflated my serial sequence, but I had two occasions
> >> when not. The 69 -> 70 was one. The inflated increase is always 33:
> >
> > AFAIKS sequences are pre-logged with 32 values to WAL to avoid
> > overhead. I suspect this is why you are seeing those gaps.
> 
> Then it should happen all the time, even with "-m fast" or "-m smart", no?

Nope, because on a normal shutdown it writes out the actual value. When
you say "immediate" you mean "right now, don't bother with anything not
important", like for example gaps in sequences. You're essentially
crashing the DB.

Have a ncie day,
-- 
Martijn van Oosterhout   <kleptog(at)svana(dot)org>   http://svana.org/kleptog/
> Patriotism is when love of your own people comes first; nationalism,
> when hate for people other than your own comes first. 
>                                       - Charles de Gaulle

In response to

Responses

pgsql-hackers by date

Next:From: Robert HaasDate: 2010-04-11 01:43:28
Subject: Re: Virtual Private Database
Previous:From: Robert HaasDate: 2010-04-10 19:04:27
Subject: Re: extended operator classes vs. type interfaces

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group