From: | "Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | self-deadlock at FATAL exit of boostrap process on read error |
Date: | 2006-06-07 11:14:49 |
Message-ID: | e66cfj$2l8q$1@news.hub.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
I encounter a situation that the server can't shutdown when a boostrap
process does ReadBuffer() but gets an read error. I guess the problem may be
like this - the boostrap process can't read at line:
smgrread(reln->rd_smgr, blockNum, (char *) bufBlock);
So it does a FATAL exit and shmem_exit() is called:
while (--on_shmem_exit_index >= 0)
(*on_shmem_exit_list[on_shmem_exit_index].function) (code,
on_shmem_exit_list[on_shmem_exit_index].arg);
Where
on_shmem_exit_list[0] = DummyProcKill
on_shmem_exit_list[1] = AtProcExit_Buffers
The above callback is called in a stack order, so AtProcExit_Buffers() will
call AbortBufferIO() which is blocked by itself on "io_in_progress_lock"
(which is not the case as the comment says "since LWLockReleaseAll has
already been called, we're not holding the buffer's io_in_progress_lock").
There may other similar problems for bootstrap process like this, so I am
not sure the best fix for this ...
Regards,
Qingqing
From | Date | Subject | |
---|---|---|---|
Next Message | Zdenek Kotala | 2006-06-07 11:48:50 | Re: How to avoid transaction ID wrap |
Previous Message | Simon Riggs | 2006-06-07 10:59:50 | Re: Compression and on-disk sorting |