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 1j9bxa-0008J2-L5 for pgsql-hackers@arkaria.postgresql.org; Wed, 04 Mar 2020 21:53:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j9bxZ-0006hK-D6 for pgsql-hackers@arkaria.postgresql.org; Wed, 04 Mar 2020 21:53:45 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j9bxZ-0006hD-1L for pgsql-hackers@lists.postgresql.org; Wed, 04 Mar 2020 21:53:45 +0000 Received: from mail-yw1-xc32.google.com ([2607:f8b0:4864:20::c32]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j9bxV-0008UD-Ps for pgsql-hackers@postgresql.org; Wed, 04 Mar 2020 21:53:43 +0000 Received: by mail-yw1-xc32.google.com with SMTP id d206so3552527ywa.12 for ; Wed, 04 Mar 2020 13:53:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=WwN0hqYjlfZXhskubLH6HHmwt2Mq38pAXzdlEZdMgfQ=; b=BLhxnYo90OT/0r7dQSnZo0kaPJBiyIGSvVgrqX8cw60JmX9YQKCBJUuketl9wcEqPv SrTc04Ag+H5rW4nRm4VHommQsSsTJ81t26cv7A+WS6bg3aAs+PtEL0R4Op1kv5GZAFz+ H5emRjs1oIB9EQo1N2ziapnjsUxwiXFHyAfjWWJ+mDWJU4BzGRucEum6F/rEDu+MqeEl zM4TedmBVd8kwk6qTHo8k4EqbmE0bybaIf/O1LKho5fpRHek25+8PBmnnDPgnLgSv2MT 6VAnjDLRJBcXfAbfT/9iTfRBTd4Fbmc5QEGAZfS2GGfnrAc/UO5FDalmB+43RmlU3+2M tyaA== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=WwN0hqYjlfZXhskubLH6HHmwt2Mq38pAXzdlEZdMgfQ=; b=JEvofvyhNhP9cudQ1TaMLcRcDoKuyiwh09w+611KolByp1eMp1p3t1E4jjWxSIdwZg XStVRlsI+3fpeaNKvI3SibXZc2uzI9/xY7h34I/XwYQ24crxDHatfuLl9FzLRgahh1aU 3HkjFrxnxJBgGqXlDoi1VOw5v409K3XcF9TfE4REbRzSvbfJW1qkoBAXv/4P3c2Ndtf9 NtVCx8St7swUXd7iDVDeLaZRYcxO2NyfAWKE9HYER9CeZwVw3LrT5g5NzB+a4cRJoMDN w+jPX5TRcPuZbKPyOsED3g2/HgU1R52sjMVG+CfB+/YmsqxpE4XtbC4kQd88j7sbJI50 WgcA== X-Gm-Message-State: ANhLgQ0BFbXaLGcCOVQZmlza5XyWJmGeQAXhvoBrRfXy1DljvFupJcs8 T/ztzeZ4Jil0tvjuoYQ1J/Snjg== X-Google-Smtp-Source: ADFU+vtydDInBiDQPHQlzB4rQbgK9MwWhRVyaoihdAO2LTrm0c2EH8Odna5oWSUOM8Dc5HOE/cfeWg== X-Received: by 2002:a25:6585:: with SMTP id z127mr4441793ybb.493.1583358820957; Wed, 04 Mar 2020 13:53:40 -0800 (PST) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id o13sm9748622ywl.9.2020.03.04.13.53.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Mar 2020 13:53:40 -0800 (PST) Received: by pryzbyj (Postfix, from userid 1000) id 053B0800926; Wed, 4 Mar 2020 15:53:38 -0600 (CST) Date: Wed, 4 Mar 2020 15:53:38 -0600 From: Justin Pryzby To: Alvaro Herrera Cc: Masahiko Sawada , Andres Freund , Michael Paquier , pgsql-hackers@postgresql.org Subject: Re: error context for vacuum to include block number Message-ID: <20200304215338.GA31435@telsasoft.com> References: <20200303193205.GG684@telsasoft.com> <20200303194900.GA17197@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200303194900.GA17197@alvherre.pgsql> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, Mar 03, 2020 at 04:49:00PM -0300, Alvaro Herrera wrote: > 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\"", > > > > > > 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. No - the issue I observed from autovacuum ("while scanning block number 4294967295") was unrelated to showing multiple context lines (that issue I only saw in the v22 patch, and was related to vacuum_one_index being used by both leader and parallel workers). The locations showing a block number first set vacrelstats->blkno to InvalidBlockNumber, and then later update the vacrelstats->blkno from a loop variable. I think today's v24 patch makes it harder to hit the window where it's set to InvalidBlockNumber, by moving VACUUM_HEAP context into vacuum_page(), but I don't think we should rely on an absence of CHECK_FOR_INTERRUPTS() to avoid misleading noise context. -- Justin