Re: [HACKERS] WAL dirty-buffer management bug

2006-03-31 Thread Tom Lane
I wrote: > I'm thinking we should change the code and the README to specify that > you must mark the buffer dirty before you can END_CRIT_SECTION(). While looking at this I realized that in fact we need to, and do, mark the buffer dirty even earlier than that: look at bufmgr.c LockBuffer and SyncO

Re: [HACKERS] WAL dirty-buffer management bug

2006-03-31 Thread Simon Riggs
On Fri, 2006-03-31 at 09:36 -0500, Tom Lane wrote: > Simon Riggs <[EMAIL PROTECTED]> writes: > > Problem for indexes only. heap xlrecs don't specify exact insert points > > Sure they do. They had better, else (for example) the associated index > insertions will be wrong. Yep, you're right. Best

Re: [HACKERS] WAL dirty-buffer management bug

2006-03-31 Thread Tom Lane
"Qingqing Zhou" <[EMAIL PROTECTED]> writes: > It may be not good but not harmful either. On step2, the transaction will > abort and leave a page that has been changed but not marked dirty. There are > two situtations could happen after that. One is step 3, the other is the > page is still in the bu

Re: [HACKERS] WAL dirty-buffer management bug

2006-03-31 Thread Tom Lane
Simon Riggs <[EMAIL PROTECTED]> writes: > Problem for indexes only. heap xlrecs don't specify exact insert points Sure they do. They had better, else (for example) the associated index insertions will be wrong. > Accesses to local buffers don't need to be critical sections either. True, but in

Re: [HACKERS] WAL dirty-buffer management bug

2006-03-31 Thread Simon Riggs
On Thu, 2006-03-30 at 13:51 -0500, Tom Lane wrote: > This is pretty much what heapam and btree currently do, but on looking > at it I think it's got a problem: we really ought to mark the buffer > dirty before releasing the critical section. Otherwise, if there's an > elog(ERROR) before the Write

Re: [HACKERS] WAL dirty-buffer management bug

2006-03-31 Thread Qingqing Zhou
"Tom Lane" <[EMAIL PROTECTED]> wrote > > This is pretty much what heapam and btree currently do, but on looking > at it I think it's got a problem: we really ought to mark the buffer > dirty before releasing the critical section. Otherwise, if there's an > elog(ERROR) before the WriteBuffer call