Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1j9DXT-0007Nx-3A for pgsql-hackers@arkaria.postgresql.org; Tue, 03 Mar 2020 19:49:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j9DXR-0005rh-Oa for pgsql-hackers@arkaria.postgresql.org; Tue, 03 Mar 2020 19:49:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j9DXR-0005rZ-C8 for pgsql-hackers@lists.postgresql.org; Tue, 03 Mar 2020 19:49:09 +0000 Received: from mail-qv1-xf43.google.com ([2607:f8b0:4864:20::f43]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j9DXO-0004mu-CR for pgsql-hackers@postgresql.org; Tue, 03 Mar 2020 19:49:08 +0000 Received: by mail-qv1-xf43.google.com with SMTP id ea1so2258498qvb.7 for ; Tue, 03 Mar 2020 11:49:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=2zNVuSRs1ABCYgCEk1kL1iYmVSl4otIqhpTG/PORVPE=; b=EyT1WZlRanKnVqjwGlK5xYXiP9PKUV91Tj57p/e2wFa+ZIq2kOKZ6XoBS6f46ejVf6 LM16tF7aaSup0Q810B7/dX25aPhFZxnmEp/uCsFbmFbdNuh7QoP3cQMMKeG+rh58qfgY OJTyNMTrQIXwHTcgK0dymIurX7gGJQWYz3za+2alTiltivimcIt/ttVN6SVUBxFuk/ol iQ3EQxHdrDmw0d7mSZQyHVVQIwzlOWUiSTDL3UMT7LK5GSLjc+trpjakLZml2yVk4FNl 0yzerp5zKXGSy4kjFox5Eqn+N2yvP7FNqIj4JKhezS04JUAlGlY22upVzYVUseF8w3i6 hKbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=2zNVuSRs1ABCYgCEk1kL1iYmVSl4otIqhpTG/PORVPE=; b=L3AYFf1UHODtuSeThVT8tiZ1+uuuskL9u5n+pn0lnwfbY5W20N6FkwrE0YDaJhD7Tt SZKGO2flQeNKAnfd+aKksyLPH2Tz+RWRDY2ADCXqODaLzEByGUouePil5bHgjyWPX3VZ hFxJO89QKS7mHxqFUeP272dCHnGbC4/Xg9nAmAU1Nhl/UHaSmDa129oQixkaszBO3asb NwX+GUfVdZUQkHhcLz4hN86dR6zJzDvh22x419+4Poiyuax+pUDv5/OZp3XLubR2nnPE 7FNARu32aimyCGHp9D0o+gACd/W0RfrisZ7V0aaowXq2cx4vbYIoWxLgaKg7vLC7Hsb0 FYXQ== X-Gm-Message-State: ANhLgQ2VB+iCk+8kGPHRjkUF3QZ9sywRFACYMees5uK6GyO2MhuTo73v q1edn42ZZVECnky746uddRivmA== X-Google-Smtp-Source: ADFU+vslYRKYChbycosxoiK9kMHjCEKBJijm+eiWo+rHtnY++3tE1PpYNbQcBqYJQYvIpzRJ3pFcfw== X-Received: by 2002:ad4:4e88:: with SMTP id dy8mr5488142qvb.118.1583264944244; Tue, 03 Mar 2020 11:49:04 -0800 (PST) Received: from nimloth.alvh.no-ip.org ([190.121.31.1]) by smtp.gmail.com with ESMTPSA id w2sm12800842qto.73.2020.03.03.11.49.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Mar 2020 11:49:03 -0800 (PST) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id BF74D3006B7; Tue, 3 Mar 2020 16:49:00 -0300 (-03) Date: Tue, 3 Mar 2020 16:49:00 -0300 From: Alvaro Herrera To: Justin Pryzby Cc: Masahiko Sawada , Andres Freund , Michael Paquier , pgsql-hackers@postgresql.org Subject: Re: error context for vacuum to include block number Message-ID: <20200303194900.GA17197@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200303193205.GG684@telsasoft.com> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-Mar-03, Justin Pryzby wrote: > On Thu, Feb 27, 2020 at 09:09:42PM -0300, Alvaro Herrera wrote: > > > + case PROGRESS_VACUUM_PHASE_VACUUM_HEAP: > > > + if (BlockNumberIsValid(cbarg->blkno)) > > > + errcontext("while vacuuming block %u of relation \"%s.%s\"", > > > + cbarg->blkno, cbarg->relnamespace, cbarg->relname); > > > + break; > > > > I think you should still call errcontext() when blkno is invalid. > > In my experience while testing, the conditional avoids lots of CONTEXT noise > from interrupted autovacuum, at least. I couldn't easily reproduce it with the > current patch, though, maybe due to less pushing and popping. I think you're saying that the code had the bug that too many lines were reported because of excessive stack pushes, and you worked around it by making the errcontext() be conditional; and that now the bug is fixed by avoiding the push/pop games -- which explains why you can no longer reproduce it. I don't see why you want to keep the no-longer-needed workaround. Your use of the progress-report enum now has two warts -- the "-1" value, and this one, > +#define PROGRESS_VACUUM_PHASE_VACUUM_FSM 7 /* For error reporting only */ I'd rather you define a new enum, in lazyvacuum.c. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services