Re: pgsql: Move btbulkdelete's vacuum_delay_point()

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Move btbulkdelete's vacuum_delay_point()
Date: 2006-02-15 16:08:47
Message-ID: 1420.1140019727@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Simon Riggs <simon(at)2ndquadrant(dot)com> writes:
> if (LWLockNumHeldByMe() == 0)
> pg_usleep(msec * 1000L);
> else
> elog(WARNING, "losing sleep because internal locks are held");

I did some testing yesterday with an Assert added to vacuum_delay_point:
Assert(InterruptHoldoffCount == 0 && CritSectionCount == 0);
which is basically asserting that ProcessInterrupts is allowed to
execute an interrupt. I desisted from committing this test, though,
because it's not clear that callers should not be allowed to call
vacuum_delay_point in such cases --- for the current callers it proved
fairly easy to locate the calls at places where this is certain to be OK,
but I don't want to wire in a requirement of it.

In any case, such tests don't help for the question of whether we've
missed any major loops that ought to contain vacuum_delay_point calls.
(If we were to add a worst-case-interval measurement, it might be
reasonable to not count calls that don't meet the ProcessInterrupts
condition.)

regards, tom lane

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2006-02-15 17:23:12 pgsql: Since we only use libld on AIX, don't include it in LIBS on any
Previous Message Simon Riggs 2006-02-15 15:52:23 Re: pgsql: Move btbulkdelete's vacuum_delay_point()