Re: Why does [auto-]vacuum delay not report a wait event? - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Why does [auto-]vacuum delay not report a wait event?
Date
Msg-id C71B2672-93CE-48CA-8BB8-4251A17A50AA@anarazel.de
Whole thread Raw
In response to Re: Why does [auto-]vacuum delay not report a wait event?  (Peter Geoghegan <pg@bowt.ie>)
Responses Re: Why does [auto-]vacuum delay not report a wait event?  (Peter Geoghegan <pg@bowt.ie>)
List pgsql-hackers
Hi,

On March 21, 2020 5:51:19 PM PDT, Peter Geoghegan <pg@bowt.ie> wrote:
>On Sat, Mar 21, 2020 at 5:25 PM Andres Freund <andres@anarazel.de>
>wrote:
>> > diff --git a/src/backend/access/gin/ginfast.c
>b/src/backend/access/gin/ginfast.c
>> > index 11d7ec067a..c99dc4a8be 100644
>> > --- a/src/backend/access/gin/ginfast.c
>> > +++ b/src/backend/access/gin/ginfast.c
>> > @@ -892,7 +892,7 @@ ginInsertCleanup(GinState *ginstate, bool
>full_clean,
>> >                */
>> >               processPendingPage(&accum, &datums, page,
>FirstOffsetNumber);
>> >
>> > -             vacuum_delay_point();
>> > +             stats->delay_msec += vacuum_delay_point();
>> >
>> >               /*
>> >                * Is it time to flush memory to disk?  Flush if we
>are at the end of
>> > @@ -929,7 +929,7 @@ ginInsertCleanup(GinState *ginstate, bool
>full_clean,
>> >                       {
>> >                               ginEntryInsert(ginstate, attnum, key,
>category,
>> >                                                          list,
>nlist, NULL);
>> > -                             vacuum_delay_point();
>> > +                             stats->delay_msec +=
>vacuum_delay_point();
>> >                       }
>> >
>> >                       /*
>> > @@ -1002,7 +1002,7 @@ ginInsertCleanup(GinState *ginstate, bool
>full_clean,
>> >               /*
>> >                * Read next page in pending list
>> >                */
>> > -             vacuum_delay_point();
>> > +             stats->delay_msec += vacuum_delay_point();
>> >               buffer = ReadBuffer(index, blkno);
>> >               LockBuffer(buffer, GIN_SHARE);
>> >               page = BufferGetPage(buffer);
>>
>> On a green field I'd really like to pass a 'vacuum state' struct to
>> vacuum_delay_point().
>
>In a green field situation, there'd be no ginInsertCleanup() at all.
>It is a Lovecraftian horror show. The entire thing should be scrapped
>now, in fact.

My comment is entirely unrelated to GIN, but about the way the delay infrastructure manages state (in global vars).

Andres
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.



pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Why does [auto-]vacuum delay not report a wait event?
Next
From: Peter Geoghegan
Date:
Subject: Re: Why does [auto-]vacuum delay not report a wait event?