Re: error context for vacuum to include block number

Поиск
Список
Период
Сортировка
От Justin Pryzby
Тема Re: error context for vacuum to include block number
Дата
Msg-id 20200320002909.GU26184@telsasoft.com
обсуждение исходный текст
Ответ на Re: error context for vacuum to include block number  (Justin Pryzby <pryzby@telsasoft.com>)
Ответы Re: error context for vacuum to include block number  (Amit Kapila <amit.kapila16@gmail.com>)
Список pgsql-hackers
On Thu, Mar 19, 2020 at 03:29:31PM -0500, Justin Pryzby wrote:
> I was going to suggest that we could do that by passing in a pointer to a local
> variable "LVRelStats olderrcbarg", like:
> |        update_vacuum_error_cbarg(vacrelstats, VACUUM_ERRCB_PHASE_SCAN_HEAP,
> |                                  blkno, NULL, &olderrcbarg);
> 
> and then later call:
> |update_vacuum_error_cbarg(vacrelstats, olderrcbarg.phase,
> |                                       olderrcbarg.blkno,
> |                                       olderrcbarg.indname,
> |                                       NULL);
> 
> I implemented it in a separate patch, but it may be a bad idea, due to freeing
> indname.  To exercise it, I tried to cause a crash by changing "else if
> (errcbarg->indname)" to "if" without else, but wasn't able to cause a crash,
> probably just due to having a narrow timing window.

I realized it was better for the caller to just assign the struct on its own.

Which gives me an excuse for resending patch, which is needed since I spent too
much time testing this that I failed to update the tip commit for the new
argument.

> It's probably a good idea to pass the indname rather than the relation in any
> case.

I included that with 0001.
I also fixed the argument name in the prototype (Relation rel vs indrel).

And removed these, which were the whole motivation behind saving the values.
|Set the error context while continuing heap scan

-- 
Justin

Вложения

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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Add A Glossary
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: nbtree: assertion failure in _bt_killitems() for posting tuple