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