Hi all,

I'm trying to fix a TODO item
* spinlock stuck problem when elog(FATAL) and elog(ERROR) inside bufmgr
.
But it's more difficult than I have thought.
IO_ERROR stuff in bufmgr.c has never been executed before
because of spinlock stuck abort.
As far as I see,I would have to change it.
Please help me.

Now I have a question about IO_IN_PROGRESS handling.

IO_IN_PROGRESS mask and io_in_progress_lock spinlock
are held while BufferAlloc() reads disk pages into buffer.

But seems they aren't held while writing buffers to disk,
We couldn't detect writing_IO_IN_PROGRESS and simultaneous
writing to a same page may occur.
No problem ?


And I have other questions which are irrevalent to the TODO item.

1. Why does BufferReplace() call smgrflush()(not smgrwrite()) ?
    Are there any reasons that we couldn't postpone fsync() until
    commit ?

2. Why does FlushRelationBuffers() call FlushBuffer() ?
    Isn't it a overhead to call fsync() per page ?

Regards.

Hiroshi Inoue
Inoue@tpf.co.jp

Tue, 5 Oct 1999 18:32:44 +0900
"Hiroshi Inoue" <Inoue@tpf.co.jp>
Questions about bufmgr
Hiroshi Inoue wrote:
> 
> I'm trying to fix a TODO item
> * spinlock stuck problem when elog(FATAL) and elog(ERROR) inside bufmgr

...

> And I have other questions which are irrevalent to the TODO item.
> 
> 1. Why does BufferReplace() call smgrflush()(not smgrwrite()) ?
>     Are there any reasons that we couldn't postpone fsync() until
>     commit ?
> 
> 2. Why does FlushRelationBuffers() call FlushBuffer() ?
>     Isn't it a overhead to call fsync() per page ?

Pleeease don't touch bufmgr for the moment - it will be
changed due to WAL implementation. Currently I do data 
base startup/shutdown stuff but will switch to bufmgr
in 1-2 days.

Vadim

Tue, 05 Oct 1999 17:39:50 +0800
Vadim Mikheev <vadim@krs.ru>
Re: [HACKERS] Questions about bufmgr