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

From: Andres Freund <andres(at)anarazel(dot)de>
To: Peter Geoghegan <pg(at)bowt(dot)ie>
Cc: Justin Pryzby <pryzby(at)telsasoft(dot)com>,PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Why does [auto-]vacuum delay not report a wait event?
Date: 2020-03-22 00:53:45
Message-ID: C71B2672-93CE-48CA-8BB8-4251A17A50AA@anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On March 21, 2020 5:51:19 PM PDT, Peter Geoghegan <pg(at)bowt(dot)ie> wrote:
>On Sat, Mar 21, 2020 at 5:25 PM Andres Freund <andres(at)anarazel(dot)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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2020-03-22 00:59:25 Re: Why does [auto-]vacuum delay not report a wait event?
Previous Message Peter Geoghegan 2020-03-22 00:51:19 Re: Why does [auto-]vacuum delay not report a wait event?