Re: display offset along with block number in vacuum errors - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: display offset along with block number in vacuum errors
Date
Msg-id 20200725093207.GB3510@paquier.xyz
Whole thread Raw
In response to display offset along with block number in vacuum errors  (Mahendra Singh Thalor <mahi6run@gmail.com>)
Responses Re: display offset along with block number in vacuum errors  (Mahendra Singh Thalor <mahi6run@gmail.com>)
List pgsql-hackers
On Fri, Jul 24, 2020 at 11:18:43PM +0530, Mahendra Singh Thalor wrote:
> In commit b61d161(Introduce vacuum errcontext to display additional
> information), we added vacuum errcontext to display additional
> information(block number) so that in case of vacuum error, we can identify
> which block we are getting error.  Addition to block number, if we can
> display offset, then it will be more helpful for users. So to display
> offset, here proposing two different methods(Thanks Robert for suggesting
> these 2 methods):

    new_rel_pages = count_nondeletable_pages(onerel, vacrelstats);
    vacrelstats->blkno = new_rel_pages;
+   vacrelstats->offnum = InvalidOffsetNumber;

Adding more context would be interesting for some cases, but not all
contrary to what your patch does in some code paths like
lazy_truncate_heap() as you would show up an offset of 0 for an
invalid value.  This could confuse some users.  Note that we are
careful enough to not print a context message if the block number is
invalid.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: handle a ECPG_bytea typo
Next
From: Amit Kapila
Date:
Subject: Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions