Re: error context for vacuum to include block number

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: Masahiko Sawada <masahiko(dot)sawada(at)2ndquadrant(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Michael Paquier <michael(at)paquier(dot)xyz>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: error context for vacuum to include block number
Date: 2020-03-17 06:21:09
Message-ID: CAA4eK1K5BTuni+Ykv9sPCU40Fc7vgfWmBXXwFOYzDeExugvpJg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Mar 17, 2020 at 9:52 AM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>
>
> Another minor point, don't we need to remove the error stack by doing
> "error_context_stack = errcallback.previous;" in parallel_vacuum_main?
>

Few other comments:
1. The error in lazy_vacuum_heap can either have phase
VACUUM_ERRCB_PHASE_INDEX_* or VACUUM_ERRCB_PHASE_VACUUM_HEAP depending
on when it occurs. If it occurs the first time it enters that
function before a call to lazy_vacuum_page, it will use phase
VACUUM_ERRCB_PHASE_INDEX_*, otherwise, it would use
VACUUM_ERRCB_PHASE_VACUUM_HEAP. The reason is lazy_vacuum_index or
lazy_cleanup_index won't reset the phase after leaving that function.

2. Also once we set phase as VACUUM_ERRCB_PHASE_VACUUM_HEAP via
lazy_vacuum_page, it doesn't seem to be reset to
VACUUM_ERRCB_PHASE_SCAN_HEAP even when we do scanning of the heap. I
think you need to set phase VACUUM_ERRCB_PHASE_SCAN_HEAP inside loop.

I think we need to be a bit more careful in setting/resetting the
phase information correctly so that it doesn't display the wrong info
in the context in an error message.

--
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2020-03-17 06:32:55 Re: WIP: WAL prefetch (another approach)
Previous Message Atsushi Torikoshi 2020-03-17 05:52:18 Re: add types to index storage params on doc