pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Justin Pryzby <pryzby@telsasoft.com>
To: Andres Freund <andres@anarazel.de>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: error context for vacuum to include block number
Date: Wed, 22 Jan 2020 17:17:26 -0600
Message-ID: <20200122231725.GI13621@telsasoft.com> (raw)
In-Reply-To: <20200120191120.s2pyx4ib4yubavxe@alap3.anarazel.de>
References: <20191213224735.GY2082@telsasoft.com>
	<20191215130708.GA19063@paquier.xyz>
	<20191215162712.GZ2082@telsasoft.com>
	<20191216024956.GC2344@paquier.xyz>
	<20191224012428.GK30414@telsasoft.com>
	<20191224041909.GA323806@paquier.xyz>
	<20191226155704.GA12890@telsasoft.com>
	<20200102162701.GA2709@telsasoft.com>
	<20200120054159.GT26045@telsasoft.com>
	<20200120191120.s2pyx4ib4yubavxe@alap3.anarazel.de>

On Mon, Jan 20, 2020 at 11:11:20AM -0800, Andres Freund wrote:
> > @@ -966,8 +986,11 @@ lazy_scan_heap(Relation onerel, VacuumParams *params, LVRelStats *vacrelstats,
> >  			/* Work on all the indexes, then the heap */
> > +			/* Don't use the errcontext handler outside this function */
> > +			error_context_stack = errcallback.previous;
> >  			lazy_vacuum_all_indexes(onerel, Irel, indstats,
> >  									vacrelstats, lps, nindexes);
> > +			error_context_stack = &errcallback;
> 
> Alternatively we could push another context for each index inside
> lazy_vacuum_all_indexes(). There's been plenty bugs in indexes
> triggering problems, so that could be worthwhile.

Is the callback for index vacuum useful without a block number?

FYI, I have another patch which would add DEBUG output before each stage, which
would be just as much information, and without needing to use a callback.
It's 0004 here:

https://www.postgresql.org/message-id/20200121134934.GY26045%40telsasoft.com
@@ -1752,9 +1753,12 @@ lazy_vacuum_all_indexes(Relation onerel, Relation *Irel,
        {
                int                     idx;

-               for (idx = 0; idx < nindexes; idx++)
+               for (idx = 0; idx < nindexes; idx++) {
+                       ereport(DEBUG1, (errmsg("\"%s\": vacuuming index",
+                                                       RelationGetRelationName(Irel[idx]))));
                        lazy_vacuum_index(Irel[idx], &stats[idx], vacrelstats->dead_tuples,






view thread (139+ messages)  latest in thread

Message-ID: <20200122231725.GI13621@telsasoft.com>
Permalink:  ../20200122231725.GI13621@telsasoft.com/
Also on:    postgresql.org/message-id/20200122231725.GI13621@telsasoft.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: pryzby@telsasoft.com, andres@anarazel.de, michael@paquier.xyz, alvherre@2ndquadrant.com
  Subject: Re: error context for vacuum to include block number
  In-Reply-To: <20200122231725.GI13621@telsasoft.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox