Re: Btree runtime recovery. Stuck spins. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Btree runtime recovery. Stuck spins.
Date
Msg-id 12891.981665329@sss.pgh.pa.us
Whole thread Raw
In response to Btree runtime recovery. Stuck spins.  ("Mikheev, Vadim" <vmikheev@SECTORBASE.COM>)
List pgsql-hackers
"Mikheev, Vadim" <vmikheev@SECTORBASE.COM> writes:
> 2. During tests I've got stuck spin aborts couple of times.
> So I've increased S_MAX_BUSY, placed elog(NOTICE, "WOULD BE STUCK")
> for spins == 20001 in s_lock_sleep() and rerun tests.
> I've got *many* "WOULD BE STUCK" notices but no one abort.
> Does it explain why I tried to avoid spin stuck "detection" code
> in WAL? -:)
> Shouldn't we increase S_MAX_BUSY and use ERROR instead of FATAL?

No.  If you have delays exceeding a minute, or that are even a visible
fraction of a minute, then a spinlock is NOT the correct mechanism to be
using to wait ... because guess what, it's spinning, and consuming
processor time to no purpose.  You should be using a lock instead for
anything that involves more than a trivial amount of delay.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Lamar Owen
Date:
Subject: Re: Syslog and pg_options (for RPMs)
Next
From: "Dominic J. Eidson"
Date:
Subject: Re: Syslog and pg_options (for RPMs)