Re: error context for vacuum to include block number
Justin Pryzby <pryzby@telsasoft.com>
From: Justin Pryzby <pryzby@telsasoft.com>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Masahiko Sawada <masahiko.sawada@2ndquadrant.com>, Alvaro Herrera <alvherre@2ndquadrant.com>, Andres Freund <andres@anarazel.de>, Michael Paquier <michael@paquier.xyz>, pgsql-hackers@postgresql.org
Date: 2020-03-20T00:29:09Z
Lists: pgsql-hackers
Attachments
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
Commits
-
Avoid calls to RelationGetRelationName() and RelationGetNamespace() in
- ef75140fe756 13.0 landed
-
Introduce vacuum errcontext to display additional information.
- b61d161c1463 13.0 landed
-
Fix mesurement of elapsed time during truncating heap in VACUUM.
- 007491979461 13.0 cited
-
Allow vacuum command to process indexes in parallel.
- 40d964ec997f 13.0 cited
-
Refactor code dedicated to index vacuuming in vacuumlazy.c
- 1ab41a3c8edc 13.0 landed
-
Remove duplicated progress reporting during heap scan of VACUUM
- e5a02e0fc68b 13.0 landed