Re: error context for vacuum to include block number

Поиск
Список
Период
Сортировка
От Justin Pryzby
Тема Re: error context for vacuum to include block number
Дата
Msg-id 20191213030831.GT2082@telsasoft.com
обсуждение исходный текст
Ответ на Re: error context for vacuum to include block number  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: error context for vacuum to include block number  (Michael Paquier <michael@paquier.xyz>)
Re: error context for vacuum to include block number  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
On Wed, Dec 11, 2019 at 12:33:53PM -0300, Alvaro Herrera wrote:
> On 2019-Dec-11, Justin Pryzby wrote:
> > +   cbarg.blkno = 0; /* Not known yet */
> Shouldn't you use InvalidBlockNumber for this initialization?
..
> >             pgstat_progress_update_param(PROGRESS_VACUUM_HEAP_BLKS_SCANNED, blkno);
> > +           cbarg.blkno = blkno;
> I would put this before pgstat_progress_update_param, just out of
> paranoia.
..
> Lose this hunk?

Addressed those.

> Or do you intend that this is going to be used for lazy_vacuum_heap too?
> Maybe it should.

Done in a separate patch.

On Wed, Dec 11, 2019 at 08:54:25AM -0800, Andres Freund wrote:
> Hm, wonder if could be worthwhile to not use a separate struct here, but
> instead extend one of the existing structs to contain the necessary
> information. Or perhaps have one new struct with all the necessary
> information. There's already quite a few places that do
> get_namespace_name(), for example.

Didn't find a better struct to use yet.

> > +   vacuum_error_callback_arg cbarg;
> Not a fan of "cbarg", too generic.
..
> I think this will misattribute errors that happen when in the:

Probably right.  Attached should address it. 

On Wed, Dec 11, 2019 at 08:54:25AM -0800, Andres Freund wrote:
> > +typedef struct
> > +{
> > +    char *relname;
> > +    char *relnamespace;
> > +    BlockNumber blkno;
> > +} vacuum_error_callback_arg;
> 
> Hm, wonder if could be worthwhile to not use a separate struct here, but
> instead extend one of the existing structs to contain the necessary
> information. Or perhaps have one new struct with all the necessary
> information. There's already quite a few places that do
> get_namespace_name(), for example.

> Not a fan of "cbarg", too generic.

> I think this will misattribute errors that happen when in the:

I think that's addressed after deduplicating in attached.

Deduplication revealed 2nd progress call, which seems to have been included
redundantly at c16dc1aca.

-               /* Remove tuples from heap */
-               pgstat_progress_update_param(PROGRESS_VACUUM_PHASE,
-                                                                        PROGRESS_VACUUM_PHASE_VACUUM_HEAP);

Justin

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Thomas Munro
Дата:
Сообщение: Re: On disable_cost
Следующее
От: Kyotaro Horiguchi
Дата:
Сообщение: Re: archive status ".ready" files may be created too early