[HACKERS] spinlock freeze ?(Re: INSERT/UPDATE waiting (another example))

From: "Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)jp>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Wayne Piekarski" <wayne(at)senet(dot)com(dot)au>
Cc: <pgsql-hackers(at)postgreSQL(dot)org>
Subject: [HACKERS] spinlock freeze ?(Re: INSERT/UPDATE waiting (another example))
Date: 1999-05-13 10:28:49
Message-ID: 000301be9d2b$638ea580$2801007e@cadzone.tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql

Hello all,

>
> Hi everyone!
>
>
> Tom Lane Writes:
>
> > Wayne Piekarski <wayne(at)senet(dot)com(dot)au> writes:
> > > Currently, I start up postmaster with -B 192, which I guess
> puts it below
> > > the value of 256 which causes problems. Apart from when I got past 256
> > > buffers, does the patch fix anything else that might be
> causing problems?
> >

[snip]

>
> Then another one after restarting everything:
>
> ERROR: cannot open segment 1 of relation sessions_done_id_index
>

I got the same error in my test cases.
I don't understand the cause of this error.

But it seems I found another problem instead.

spinlock io_in_progress_lock of a buffer page is not
released by operations called by elog() such as
ProcReleaseSpins(),ResetBufferPool() etc.

For example,the error we have encountered probably occured
in ReadBufferWithBufferLock().
When elog(ERROR/FATAL) occurs in smgrread/extend() which
is called from ReadBufferWithBufferLock(),smgrread/extend()
don't release the io_in_progress_lock spinlock of the page.
If other transactions get that page as a free Buffer page,those
transactions wait the release of io_in_progress_lock spinlock
and would abort with message such as

> FATAL: s_lock(1800d37c) at bufmgr.c:657, stuck spinlock. Aborting.
>
> FATAL: s_lock(1800d37c) at bufmgr.c:657, stuck spinlock. Aborting.

Comments ?

I don't know details about spinlock stuff.
Sorry,if my thought is off the point.

And I have another question.

It seems elog(FATAL) doesn't release allocated buffer pages.
It's OK ?
AFAIC elog(FATAL) causes proc_exit(0) and proc_exit() doesn't
call ResetBufferPool().

Thanks.

Hiroshi Inoue
Inoue(at)tpf(dot)co(dot)jp

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dmitry Samersoff 1999-05-13 11:24:54 RE: [HACKERS] CVS mirrors?
Previous Message Pedro J. Lobo 1999-05-13 09:47:28 CVS mirrors?

Browse pgsql-sql by date

  From Date Subject
Next Message Henrik Steffen 1999-05-13 11:14:15 Re: [SQL] VARCHAR(50), CHAR(50) or TEXT ?
Previous Message Henrik Steffen 1999-05-13 09:08:31 VARCHAR(50), CHAR(50) or TEXT ?