Re: display offset along with block number in vacuum errors

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Masahiko Sawada <masahiko(dot)sawada(at)2ndquadrant(dot)com>
Cc: Justin Pryzby <pryzby(at)telsasoft(dot)com>, Mahendra Singh Thalor <mahi6run(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: display offset along with block number in vacuum errors
Date: 2020-08-18 04:06:21
Message-ID: CAA4eK1+j4Q2U6VwCc2qrVbv5MO-a8nTXA4pKBVaqB9qwgifr-g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Aug 17, 2020 at 11:38 AM Masahiko Sawada
<masahiko(dot)sawada(at)2ndquadrant(dot)com> wrote:
>
> On Sat, 15 Aug 2020 at 12:19, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> >
> > The reason why I have not included heap_page_prune related change in
> > the patch is that I don't want to sprinkle this in every possible
> > function (code path) called via vacuum especially if the probability
> > of an error in that code path is low. But, I am fine if you and or
> > others think that it is a good idea to update offset in
> > heap_page_prune as well.
>
> I agree to not try sprinkling it many places than necessity.
>
> Regarding heap_page_prune(), I'm concerned a bit that
> heap_page_prune() is typically the first function to check the tuple
> visibility within the vacuum code. I've sometimes observed an error
> with the message like "DETAIL: could not open file “pg_xact/00AB”: No
> such file or directory" due to a tuple header corruption. I suspect
> this message was emitted while checking tuple visibility in
> heap_page_prune(). So I guess the likelihood of an error in that code
> is not so low.
>

Fair point.

> On the other hand, if we want to update the offset number in
> heap_page_prune() we will need to expose some vacuum structs defined
> as a static including LVRelStats.
>

I don't think we need to expose LVRelStats. We can just pass the
address of vacrelstats->offset_num to achieve what we want. I have
tried that and it works, see the
v6-0002-additinal-error-context-information-in-heap_page_ patch
attached. Do you see any problem with it?

--
With Regards,
Amit Kapila.

Attachment Content-Type Size
v6-0001-Add-additional-information-in-vacuum-errcontext.patch application/octet-stream 10.7 KB
v6-0002-additinal-error-context-information-in-heap_page_.patch application/octet-stream 3.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2020-08-18 04:30:21 pgsql: snapshot scalability: cache snapshots using a xact completion co
Previous Message Michael Paquier 2020-08-18 02:14:06 Re: doc examples for pghandler