Questions about bufmgr - Mailing list pgsql-hackers

From Hiroshi Inoue
Subject Questions about bufmgr
Date
Msg-id 000801bf0f14$943495e0$2801007e@cadzone.tpf.co.jp
Whole thread Raw
List pgsql-hackers
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


pgsql-hackers by date:

Previous
From: "Hiroshi Inoue"
Date:
Subject: RE: [HACKERS] Recovery on incomplete write
Next
From: Vadim Mikheev
Date:
Subject: Re: [HACKERS] Questions about bufmgr