Re: pgsql: Move btbulkdelete's vacuum_delay_point() - Mailing list pgsql-committers

From Tom Lane
Subject Re: pgsql: Move btbulkdelete's vacuum_delay_point()
Date
Msg-id 1420.1140019727@sss.pgh.pa.us
Whole thread Raw
In response to Re: pgsql: Move btbulkdelete's vacuum_delay_point()  (Simon Riggs <simon@2ndquadrant.com>)
List pgsql-committers
Simon Riggs <simon@2ndquadrant.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

pgsql-committers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: pgsql: Move btbulkdelete's vacuum_delay_point()
Next
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: Since we only use libld on AIX, don't include it in LIBS on any