Обсуждение: BUG #10736: Database does somtimes not startup again after restart

Поиск
Список
Период
Сортировка

BUG #10736: Database does somtimes not startup again after restart

От
marcel.hanke@1und1.de
Дата:
The following bug has been logged on the website:

Bug reference:      10736
Logged by:          Marcel Hanke
Email address:      marcel.hanke@1und1.de
PostgreSQL version: 9.1.13
Operating system:   Debian
Description:

After an update of any related Packet (or the postgres it self), witch
requires an restart of the Database, the db sometimes doesn't start up
again.
The Postgres is used to provide data to an Powerdns Server and runs in an
Master-Slave replication.

Errormassages:
postgres_main[3195]: [1-1] 2014-06-20 12:59:07 CEST FATAL:  the database
system is starting up
postgres_main[3196]: [1-1] 2014-06-20 12:59:07 CEST FATAL:  the database
system is starting up
pdns[3061]: gpgsql Connection failed: Unable to connect to database, connect
string: dbname=pdns user=postgres host=127.0.0.1 port=5432
password=<HIDDEN>: FATAL:  the database system is starting up
pdns[3061]: Caught an exception instantiating a backend: Unable to launch
gpgsql connection: Unable to connect to database, connect string:
dbname=pdns user=postgres host=127.0.0.1 port=5432 password=<HIDDEN>: FATAL:
 the database system is starting up
pdns[3061]: Cleaning up

The Error doesn't accrue every time. It's atm not possible to reproduce the
error on an test system, so I can't provide an debug log.

The configuration of the relevant postgres is mostly standard.
Replitation Config:
unix_socket_directory = '/var/run/postgresql'
hot_standby = on

Greetings Marcel

Re: BUG #10736: Database does somtimes not startup again after restart

От
"Tomas Vondra"
Дата:
On 23 Červen 2014, 10:33, marcel.hanke@1und1.de wrote:
> The following bug has been logged on the website:
>
> Bug reference:      10736
> Logged by:          Marcel Hanke
> Email address:      marcel.hanke@1und1.de
> PostgreSQL version: 9.1.13
> Operating system:   Debian
> Description:
>
> After an update of any related Packet (or the postgres it self), witch
> requires an restart of the Database, the db sometimes doesn't start up
> again.
> The Postgres is used to provide data to an Powerdns Server and runs in an
> Master-Slave replication.
>
> Errormassages:
> postgres_main[3195]: [1-1] 2014-06-20 12:59:07 CEST FATAL:  the database
> system is starting up
> postgres_main[3196]: [1-1] 2014-06-20 12:59:07 CEST FATAL:  the database
> system is starting up
> pdns[3061]: gpgsql Connection failed: Unable to connect to database,
> connect
> string: dbname=pdns user=postgres host=127.0.0.1 port=5432
> password=<HIDDEN>: FATAL:  the database system is starting up
> pdns[3061]: Caught an exception instantiating a backend: Unable to launch
> gpgsql connection: Unable to connect to database, connect string:
> dbname=pdns user=postgres host=127.0.0.1 port=5432 password=<HIDDEN>:
> FATAL:
>  the database system is starting up
> pdns[3061]: Cleaning up
>
> The Error doesn't accrue every time. It's atm not possible to reproduce
> the
> error on an test system, so I can't provide an debug log.

Well, I don't know how you start the database, but for example pg_ctl does
not guarantee the startup to be complete unless "-w" option is used. It
simply initiates the startup and returns. On a busy system this may easily
take several seconds (and then you'd see the errors you posted when
attempting to access the DB before the startup completed).

I.e. this is expected feature, not a bug. If you need to prevent this, use
the "-w" option (not sure which OS / distribution you use, so not sure
which init script pg_ctl is called from).

regards
Tomas