Обсуждение: PostgreSQL 9.0.2 hangs during shutdown on Windows (Win32)

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

PostgreSQL 9.0.2 hangs during shutdown on Windows (Win32)

От
Alexandros Karypidis
Дата:
Hello,

I am using PostgreSQL 9.0.2-1 (specifically the pre-compiled ZIP distribution
for Win32, postgresql-9.0.2-1-windows-binaries.zip, from EnterpriseDB
http://www.enterprisedb.com/postgresql-902-binaries-win32?ls=Crossover&type=Crossover).


The Host is an Intel x86 (Core2Duo) machine running Windows XP SP3 (32-bit).

When I try to shut down the database, it always hangs. Even if I simply start
the DB and then issue a shutdown (with no connections being made and no SQL
executed in between) the DB still hangs. I appreciate any info on what to do to
resolve this.

I have increased the log level to DEBUG5 (log_min_messages and
log_min_error_statement) and the output of the server is:

------------------------- START DEBUG OUTPUT
LOG:  database system is ready to accept connections
LOG:  autovacuum launcher started
DEBUG:  InitPostgres
DEBUG:  my backend id is 1
DEBUG:  mapped win32 error code 2 to 2
DEBUG:  StartTransaction
DEBUG:  name: unnamed; blockState:       DEFAULT; state: INPROGR, xid/subid/cid:
0/1/0, nestlvl: 1, children:
DEBUG:  CommitTransaction
DEBUG:  name: unnamed; blockState:       STARTED; state: INPROGR, xid/subid/cid:
0/1/0, nestlvl: 1, children:
DEBUG:  mapped win32 error code 2 to 2

===> ...Message above repeated several times

DEBUG:  mapped win32 error code 2 to 2

===> This is where I immediately try a clean shutdown:

DEBUG:  postmaster received signal 15
LOG:  received smart shutdown request
LOG:  autovacuum launcher shutting down
DEBUG:  shmem_exit(0): 7 callbacks to make
DEBUG:  proc_exit(0): 2 callbacks to make
DEBUG:  shmem_exit(0): 4 callbacks to make
DEBUG:  exit(0)
DEBUG:  proc_exit(0): 2 callbacks to make
DEBUG:  shmem_exit(-1): 0 callbacks to make
DEBUG:  exit(0)
DEBUG:  proc_exit(-1): 0 callbacks to make
DEBUG:  shmem_exit(-1): 0 callbacks to make
DEBUG:  proc_exit(-1): 0 callbacks to make
DEBUG:  reaping dead processes
DEBUG:  reaping dead processes
LOG:  shutting down
DEBUG:  attempting to remove WAL segments older than log file
000000010000000000000002
LOG:  database system is shut down
DEBUG:  shmem_exit(0): 4 callbacks to make
DEBUG:  proc_exit(0): 2 callbacks to make
DEBUG:  exit(0)
DEBUG:  shmem_exit(-1): 0 callbacks to make
DEBUG:  proc_exit(-1): 0 callbacks to make
DEBUG:  reaping dead processes



Re: PostgreSQL 9.0.2 hangs during shutdown on Windows (Win32)

От
Alexandros Karypidis
Дата:
Forgot to mention that:

1. After the shutdown request, I can see that there are still two processes
running (postgres.exe). One of the two is hogging the CPU (it uses one of the
two cores 100%, so it shows up as 50 on the task manager). The other seems to be
waiting, using 0%.

2. If I go to the command prompt where the server is running and hit Ctrl-C, the
following additional output is logged:

DEBUG:  postmaster received signal 2
LOG:  received fast shutdown request

Still, nothing happens.

3. If I kill the idle one of the two "stuck" postgress.exe via the task manager,
there is nothing additional logged by the server:

4. If I kill the busy one of the two "stuck" postgress.exe via the task
manager, the following output is additionally logged by the server:

DEBUG:  reaping dead processes
LOG:  statistics collector process (PID 4264) exited with exit code 1
DEBUG:  shmem_exit(0): 2 callbacks to make
DEBUG:  proc_exit(0): 1 callbacks to make
DEBUG:  exit(0)
DEBUG:  shmem_exit(-1): 0 callbacks to make
DEBUG:  proc_exit(-1): 0 callbacks to make

5. On the client side (the command window where I ran that shutdown command:
pg_ctl stop -D %PGDATA_HOME%) I see:

waiting for server to shut
down............................................................... failed
pg_ctl: server does not shut down




----- Original Message ----
From: Alexandros Karypidis <akarypid@yahoo.gr>
To: pgsql-general@postgresql.org
Sent: Mon, January 17, 2011 12:28:05 PM
Subject: PostgreSQL 9.0.2 hangs during shutdown on Windows (Win32)

Hello,

I am using PostgreSQL 9.0.2-1 (specifically the pre-compiled ZIP distribution
for Win32, postgresql-9.0.2-1-windows-binaries.zip, from EnterpriseDB
http://www.enterprisedb.com/postgresql-902-binaries-win32?ls=Crossover&type=Crossover).



The Host is an Intel x86 (Core2Duo) machine running Windows XP SP3 (32-bit).

When I try to shut down the database, it always hangs. Even if I simply start
the DB and then issue a shutdown (with no connections being made and no SQL
executed in between) the DB still hangs. I appreciate any info on what to do to
resolve this.

I have increased the log level to DEBUG5 (log_min_messages and
log_min_error_statement) and the output of the server is:

------------------------- START DEBUG OUTPUT
LOG:  database system is ready to accept connections
LOG:  autovacuum launcher started
DEBUG:  InitPostgres
DEBUG:  my backend id is 1
DEBUG:  mapped win32 error code 2 to 2
DEBUG:  StartTransaction
DEBUG:  name: unnamed; blockState:       DEFAULT; state: INPROGR, xid/subid/cid:

0/1/0, nestlvl: 1, children:
DEBUG:  CommitTransaction
DEBUG:  name: unnamed; blockState:       STARTED; state: INPROGR, xid/subid/cid:

0/1/0, nestlvl: 1, children:
DEBUG:  mapped win32 error code 2 to 2

===> ...Message above repeated several times

DEBUG:  mapped win32 error code 2 to 2

===> This is where I immediately try a clean shutdown:

DEBUG:  postmaster received signal 15
LOG:  received smart shutdown request
LOG:  autovacuum launcher shutting down
DEBUG:  shmem_exit(0): 7 callbacks to make
DEBUG:  proc_exit(0): 2 callbacks to make
DEBUG:  shmem_exit(0): 4 callbacks to make
DEBUG:  exit(0)
DEBUG:  proc_exit(0): 2 callbacks to make
DEBUG:  shmem_exit(-1): 0 callbacks to make
DEBUG:  exit(0)
DEBUG:  proc_exit(-1): 0 callbacks to make
DEBUG:  shmem_exit(-1): 0 callbacks to make
DEBUG:  proc_exit(-1): 0 callbacks to make
DEBUG:  reaping dead processes
DEBUG:  reaping dead processes
LOG:  shutting down
DEBUG:  attempting to remove WAL segments older than log file
000000010000000000000002
LOG:  database system is shut down
DEBUG:  shmem_exit(0): 4 callbacks to make
DEBUG:  proc_exit(0): 2 callbacks to make
DEBUG:  exit(0)
DEBUG:  shmem_exit(-1): 0 callbacks to make
DEBUG:  proc_exit(-1): 0 callbacks to make
DEBUG:  reaping dead processes



Re: PostgreSQL 9.0.2 hangs during shutdown on Windows (Win32)

От
Craig Ringer
Дата:
On 01/17/2011 06:44 PM, Alexandros Karypidis wrote:
> Forgot to mention that:
>
> 1. After the shutdown request, I can see that there are still two processes
> running (postgres.exe). One of the two is hogging the CPU (it uses one of the
> two cores 100%, so it shows up as 50 on the task manager). The other seems to be
> waiting, using 0%.

Thanks for the additional information.

What virus scanner do you have installed? Does the problem persist when
you exclude "postgres.exe", the postgres program directory and the
postgres data directory from scanning?

> When I try to shut down the database, it always hangs. Even if I simply start
> the DB and then issue a shutdown (with no connections being made and no SQL
> executed in between) the DB still hangs. I appreciate any info on what to do to
> resolve this.

A backtrace of both "stuck" processes would be helpful in determining
what it is that they're up to. As they're stuck in an apparently
infinite loop, taking several samples would be preferable as different
samples will be at different places in whatever loop they're stuck in.

Instructions on how to install debugging tools and obtain a stack trace
can be found here:

http://wiki.postgresql.org/wiki/Getting_a_stack_trace_of_a_running_PostgreSQL_backend_on_Windows

--
Craig Ringer