Re: error context for vacuum to include block number
Justin Pryzby <pryzby@telsasoft.com>
From: Justin Pryzby <pryzby@telsasoft.com>
To: Masahiko Sawada <masahiko.sawada@2ndquadrant.com>
Cc: Andres Freund <andres@anarazel.de>, Michael Paquier <michael@paquier.xyz>, Alvaro Herrera <alvherre@2ndquadrant.com>, pgsql-hackers@postgresql.org
Date: 2020-02-08T01:01:07Z
Lists: pgsql-hackers
Attachments
On Tue, Feb 04, 2020 at 01:58:20PM +0900, Masahiko Sawada wrote:
> Here is the comment for v16 patch:
>
> 2.
> I think we can set the error context for heap scan again after
> freespace map vacuum finishing, maybe after reporting the new phase.
> Otherwise the user will get confused if an error occurs during
> freespace map vacuum. And I think the comment is unclear, how about
> "Set the error context fro heap scan again"?
Good point
> 3.
> + if (cbarg->blkno!=InvalidBlockNumber)
> + errcontext(_("while scanning block %u of relation \"%s.%s\""),
> + cbarg->blkno, cbarg->relnamespace, cbarg->relname);
>
> We can use BlockNumberIsValid macro instead.
Thanks. See attached, now squished together patches.
I added functions to initialize the callbacks, so error handling is out of the
way and minimally distract from the rest of vacuum.
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