Re: FATAL: the database system is starting up

From: patrick keshishian <pkeshish(at)gmail(dot)com>
To: "William E(dot) Moreno A(dot)" <wmoreno3(at)yahoo(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, "Artis(dot)Caune(at)latnet(dot)lv" <Artis(dot)Caune(at)latnet(dot)lv>
Subject: Re: FATAL: the database system is starting up
Date: 2011-10-27 00:09:28
Message-ID: CAN0yQBp+mfHiwisWUEQuzBqrSamGH=Z95stwRUoWMuiVBWqZtw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Oct 26, 2011 at 4:49 PM, William E. Moreno A.
<wmoreno3(at)yahoo(dot)com> wrote:
> Solution: http://archives.postgresql.org/pgsql-general/2007-12/msg01339.php
> Solution: Message-id: <476D6DE1(dot)4050600(at)latnet(dot)lv>
> <text/plain>
>
> Problem: FATAL:  the database system is starting up
>
> Solved:   change postgresql_flags in /etc/rc.conf to: postgresql_flags="-s -m fast" or postgresql_flags="-s -m smart"

interesting enough, got bit by this recently. Our set up does not have
a "-w" option. During upgrades we "cycle" our PostgreSQL daemon. We
had to change the "pg_ctl stop" command to "-mimmediate" because
during upgrades we would find that someone had an abandoned psql shell
running for days and that would halt our upgrade script.

Adding "-m immediate" for shutdown seemed like a logical choice to get
around this sort of a "procedural" issue(s).

But I see this in our PostgreSQL log (warning: gmail will wrap lines):

Oct 26 15:41:53 foo postgres[20168]: [51-1] NOTICE: ALTER TABLE / ADD
PRIMARY KEY ...
Oct 26 15:48:42 foo postgres[19909]: [1-1] LOG: received immediate
shutdown request
Oct 26 15:48:44 foo postgres[21919]: [1-1] LOG: database system was
interrupted at 2011-10-26 15:45:21 GMT
Oct 26 15:48:44 foo postgres[21919]: [2-1] LOG: checkpoint record is
at 10/8C21F898
Oct 26 15:48:44 foo postgres[21919]: [3-1] LOG: redo record is at
10/8C21F898; undo record is at 0/0; shutdown FALSE
Oct 26 15:48:44 foo postgres[21919]: [4-1] LOG: next transaction ID:
176547132; next OID: 40216935
Oct 26 15:48:44 foo postgres[21919]: [5-1] LOG: database system was
not properly shut down; automatic recovery in progress
Oct 26 15:48:44 foo postgres[21920]: [1-1] FATAL: the database system
is starting up
Oct 26 15:48:45 foo postgres[21919]: [6-1] LOG: redo starts at 10/8C21F8D8
Oct 26 15:48:45 foo postgres[21919]: [7-1] LOG: record with zero
length at 10/8C2D1D38
Oct 26 15:48:45 foo postgres[21919]: [8-1] LOG: redo done at 10/8C2D1D14
Oct 26 15:48:46 foo postgres[21922]: [1-1] FATAL: the database system
is starting up
Oct 26 15:48:47 foo postgres[21925]: [1-1] FATAL: the database system
is starting up
Oct 26 15:48:48 foo postgres[21930]: [1-1] FATAL: the database system
is starting up
Oct 26 15:48:48 foo postgres[21919]: [9-1] LOG: recycled transaction
log file "000000100000008B"
Oct 26 15:48:48 foo postgres[21919]: [10-1] LOG: database system is ready

[above output is from a PG7.4.x, but have noticed similar behavior in PG9.1.1]

In order to retain the "immediate" option for shutdown, I added a
three second sleep in our upgrade script after the "cycle" command.

Kinda hacky but ...

--patrick

> Operatin System: FreeBSD 8.2 p4
>
> Database:            PostgreSQL Server 8.2.9_2
>
> I have had a lot of work trying to solve this issue, and I finally found the solution.
> Why at this time, with the latest version of PostgreSQL 8.4.9_2 this isssue continue ?
> I knew by the logs, that many people have the same or similar problem.
>
> Another issue that I have with this version 8.4.9_2 of PostgreSQL. Is about pgsql user that is not created in a clean install, via ports. PostgreSQL version 8.3 creates pgsql user, but not version 8.4.
>
> Thanks Very Much
>
> I'm happy with the solution found and waiting for the other about the pgsql user creation in version 8.4.9_2
>
> P.D.: El presente correo no contiene tildes para evitarle al receptor
> inconvenientes en su lectura.
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2011-10-27 00:46:22 Re: FATAL: the database system is starting up
Previous Message William E. Moreno A. 2011-10-26 23:49:15 FATAL: the database system is starting up