Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mkzdZ-0004zr-Ef for pgsql-bugs@arkaria.postgresql.org; Thu, 11 Nov 2021 02:16:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mkzdX-00011v-LR for pgsql-bugs@arkaria.postgresql.org; Thu, 11 Nov 2021 02:16:23 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mkzdX-00011i-Cm for pgsql-bugs@lists.postgresql.org; Thu, 11 Nov 2021 02:16:23 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mkzdV-0002a7-6x for pgsql-bugs@lists.postgresql.org; Thu, 11 Nov 2021 02:16:22 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id D56925C040C; Wed, 10 Nov 2021 21:16:19 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 10 Nov 2021 21:16:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=FHKQSBiD7t6Vom5mzSUlin+NiDd 4pqL2sCRWt73+DhM=; b=RfAuZI70qpePavxTOP9h/4tWOScaNWuEeQN26kVxfhG gmi7dAst6yCxv2sUOSJYDlub5mLCT1yf7OkchEyTm2UYVRZ2wXk0GOmQkp1dY8Ea X9zrJC8TcXeZ5YTug8MMgsLKzAugyA+4ef30iq6OL//4C0V4AaXpCpakmLSw7jfp 4FzR6+WoHJWhZI/QlYDoxKiUC57NNLtcn12QVbUMQta//JdwHpy3B3C2tLZ3AEqn ZGmwLyWzKTSkXQO8UA4bIRDbj77UXttCR0LSRPm4mtOTGKzQvm6ybSjDzVXryVFb etn17TnNa4Z5WZ2S0Ug6+x0PUbhnDobjGivCp5+6wTg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=FHKQSB iD7t6Vom5mzSUlin+NiDd4pqL2sCRWt73+DhM=; b=i4HQo56nVO3IJHX38Hvk6F HFtvLk0qzBOIXWBjnEmqUQyyTt9757IJLATaBKO/DammlervPfITNepzxC0Nktbn w78CKB60onQtBISO54UlI3FoKMg/KVtacBmwD8vKX/gibNLO9EzN0awRtV/8ZhHo 208fi4EPfVpUMz34MYY7qotfOiGgKpggm0h4jLA/wTp5F3vV2vcMrXY4BGT4ytG5 hZ4jJkO5pyRTZnqc7h299pE+W1y5c5Vrk2MNQ0PyBuOQ9ewVnGqTaoFwkc73iWr1 7DsXQDOWHtG1lP30Emio0VOmhPMIZP0DXb/YvCIQapBDPlpDd0WsWtYFxYmAIm/g == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrvddtgdegudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomheptehnughrvghs ucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrfgrth htvghrnhepudekhfekleeugeevteehleffffejgeelueduleeffeeutdelffeujeffhfeu ffdunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hnughrvghssegrnhgrrhgriigvlhdruggv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 10 Nov 2021 21:16:19 -0500 (EST) Date: Wed, 10 Nov 2021 18:16:18 -0800 From: Andres Freund To: Peter Geoghegan Cc: Dmitry Dolgov <9erthalion6@gmail.com>, Alexander Lakhin , Matthias van de Meent , PostgreSQL mailing lists Subject: Re: BUG #17255: Server crashes in index_delete_sort_cmp() due to race condition with vacuum Message-ID: <20211111021618.n5ebam6f6licj746@alap3.anarazel.de> References: <08c2445c-c3c9-ba45-18d3-6399707d8306@gmail.com> <20211108172852.pvsarxoxi54uatch@localhost> <20211109150216.fgfybn35mwnkeef3@localhost> <20211110192010.ckvfzz352hsba5xf@alap3.anarazel.de> <20211111004727.imn7xrimdiyo7vfv@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2021-11-10 17:37:38 -0800, Peter Geoghegan wrote: > On Wed, Nov 10, 2021 at 4:47 PM Andres Freund wrote: > Offhand I'd say that it would be a good idea to add comments over the > call to vacuum_set_xid_limits() made from vacuumlazy.c. Hm. To me all of this is more general than vacuum[lazy].c. Or even than anything heap related. > You might also move the call to GlobalVisTestFor() out of > lazy_scan_heap(), so that it gets called right after > vacuum_set_xid_limits(). That would make the new explanation easier to > follow, since you are after all explaining the relationship between > OldestXmin (or the vacuum_set_xid_limits() call itself) and vistest > (or the GlobalVisTestFor() call itself). > > Why do they have to be called in that order? Or do they? I noticed > that "make check-world" won't break if you switch the order. We need pruning to be at least as aggressive as relfrozenxid. If we did it the other way round, we couldn't guarantee that. I think we should work towards not actually using a statically determined relfrozenxid. We cause a lot of unnecessary re-vacuuming by using a static cutoff - instead we should check what the actually oldest xid in the table is and set relfrozenxid to that. Greetings, Andres Freund