Re: [HACKERS] Block level parallel vacuum

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Cc: Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>, Robert Haas <robertmhaas(at)gmail(dot)com>, Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>, David Steele <david(at)pgmasters(dot)net>, Claudio Freire <klaussfreire(at)gmail(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] Block level parallel vacuum
Date: 2019-10-07 05:23:51
Message-ID: CAA4eK1K-gotKzyjuaU0FPsX9duGMrJR-8ySUyH8eKVXZSxF+hA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Oct 7, 2019 at 10:00 AM Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
wrote:

> On Sat, Oct 5, 2019 at 8:22 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
> wrote:
> >
> > On Fri, Oct 4, 2019 at 7:57 PM Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
> wrote:
> >>
> >> On Fri, Oct 4, 2019 at 2:31 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
> wrote:
> >> >>
> >> >
> >> > Do we really need to log all those messages? The other places where
> we launch parallel workers doesn't seem to be using such messages. Why do
> you think it is important to log the messages here when other cases don't
> use it?
> >>
> >> Well I would rather think that parallel create index doesn't log
> >> enough messages. Parallel maintenance operation is invoked manually by
> >> user. I can imagine that DBA wants to cancel and try the operation
> >> again later if enough workers are not launched. But there is not a
> >> convenient way to confirm how many parallel workers planned and
> >> actually launched. We need to see ps command or pg_stat_activity.
> >> That's why I think that log message would be helpful for users.
> >
> >
> > Hmm, what is a guarantee at a later time the user will get the required
> number of workers? I think if the user decides to vacuum, then she would
> want it to start sooner. Also, to cancel the vacuum, for this reason, the
> user needs to monitor logs which don't seem to be an easy thing considering
> this information will be logged at DEBUG2 level. I think it is better to
> add in docs that we don't guarantee that the number of workers the user has
> asked or expected to use for a parallel vacuum will be available during
> execution. Even if there is a compelling reason (which I don't see) to
> log this information, I think we shouldn't use more than one message to log
> (like there is no need for a separate message for cleanup and vacuuming)
> this information.
> >
>
> I think that there is use case where user wants to cancel a
> long-running analytic query using parallel workers to use parallel
> workers for parallel vacuum instead. That way the lazy vacuum will
> eventually complete soon. Or user would want to see the vacuum log to
> check if lazy vacuum has been done with how many parallel workers for
> diagnostic when the vacuum took a long time. This log information
> appears when VERBOSE option is specified. When executing VACUUM
> command it's quite common to specify VERBOSE option to see the vacuum
> execution more details and VACUUM VERBOSE already emits very detailed
> information such as how many frozen pages are skipped and OldestXmin.
> So I think this information would not be too odd for that. Are you
> concerned that this information takes many lines of code? or it's not
> worth to be logged?
>

To an extent both, but I see the point you are making. So, we should try
to minimize the number of lines used to log this message. If we can use
just one message to log this information, that would be ideal.

>
> I agreed to add in docs that we don't guarantee that the number of
> workers user requested will be available.
>

Okay.

--
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Sharma 2019-10-07 05:27:09 Re: Change atoi to strtol in same place
Previous Message David Rowley 2019-10-07 05:10:05 Re: Change atoi to strtol in same place