Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1vGKkG-00ChG1-7k for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Nov 2025 17:22:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1vGKkE-00FOkB-Mn for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Nov 2025 17:22:57 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1vGKkE-00FOk0-BB for pgsql-hackers@lists.postgresql.org; Tue, 04 Nov 2025 17:22:57 +0000 Received: from fout-a6-smtp.messagingengine.com ([103.168.172.149]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1vGKkB-005RA6-1d for pgsql-hackers@lists.postgresql.org; Tue, 04 Nov 2025 17:22:56 +0000 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfout.phl.internal (Postfix) with ESMTP id BFCF2EC0533; Tue, 4 Nov 2025 12:22:54 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Tue, 04 Nov 2025 12:22:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kurilemu.de; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to; s=fm1; t=1762276974; x= 1762363374; bh=0ei6aqAlj0j5AI7YwqVTYaBUM1qFnH5SBAThlCyg0xs=; b=B 0JeywXDHVVcMgI5WU7sg3dpUB6mdxOjfiYrD5erWgoKADUwwdegrpwT2nxVn9XCN JefhNDclaSDVHQcNaEH5jSEBFKRauAM7NkUG14L9UtCXFieCZsYtq2vVe3EF7Zc/ Vk0dh6Ycff1yQOUThhYwUnEi5xDDznN/i2ZGjP55IFR3yopUiJkjP/OAdEQs6BEi Kc7SIZ7lBmhYQbN+UPsGI9khKkVIvxAzvPYEnIY7hwIqk6L549PUbjg8QYNIypYi fTNHppgepepV4MWkPZ70PkQtvDUd+QlPUlVAjQLKzG3jvLhS8AsBsk1JjEWOS29v NHsjG+PFXPiCWaB8QsdTw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1762276974; x=1762363374; bh=0 ei6aqAlj0j5AI7YwqVTYaBUM1qFnH5SBAThlCyg0xs=; b=gZA7dhgjodk15qTZ2 w8QENN+o+DT9S6vgUzQR9yPu/K+mY4GmO0Wvl2hi/YjnGJUgVJBD0ZeeP6ILypCP 19UiSeZ4ShMtP76HMYrY/3rkk9ZS/64uhZno8UXEewRNWi3OufXDNJyEyLJpnQgn ANzDSm2MZZxd1h1W+sJi009u3iM7CaHWhOIQ/A6gyxgQt3dQJgsp3w3PylLF4bO+ yM9FdCYQ4UYIiAAdopBoehCuFwxJze8Vyo1cbxp2gwbsj7oQCNKbOU8bxZT/J9HO iwJwloeFNrNAbBeJSDaLuZd6vFViyXex++3vl9Wjo5velNbudblK9TQ506jC7HYV zRjQA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddukeduieduucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheplmhlvhgrrhho ucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsehkuhhrihhlvghmuhdruggvqeenucggtf frrghtthgvrhhnpeetuedvheffkeevgfeuheevteevkefggedttdeufeeuheduuddthfef fffhjeefffenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmnecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgv sehkuhhrihhlvghmuhdruggvpdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpoh huthdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehlihhsthhsrdhpohhsthhg rhgvshhqlhdrohhrghdprhgtphhtthhopehmihgthhgrvghlsehprghquhhivghrrdighi ii X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 4 Nov 2025 12:22:53 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1762276970; bh=xoQhuJbPM+IPVuhhNwDYwl68rGIZrZG6IyoEmQKppaA=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=Ki3F04YU7E3lf5PHYLh7de3JJ/7GCG5ydRgQ56oRExx8UVi2Gj9LsyQf96zFip6Tn DHfvLrkRHTdhScIB8fJDvbRkqJYYFCBJ27cOp+m4u066CL/vkkAfwiv2fPDl2EhiMW Q8ciWkLulKp9QGJ1Dh4JkHh3Dqjw4q3IBM1PNrl0BgBxMZ+yZnQEgX3D7nsf4Cdetw 29vrrD1tjyJA9+M4WMAcqJpgX5Y5eZ/oEAQIsXAbw2MAL1BdU5bgp1FkEQ2BfF02Zv kFAuZELTslY9Yx7SgY7O5juY85qh5oICHdanrdzNc/+JY7XYReY4HL7pEK1vYE//oT 5uNpNLDAQzZ1w== Received: by schmee.kurilemu.internal (Postfix, from userid 1000) id 90BFC76; Tue, 04 Nov 2025 19:22:50 +0200 (EET) Date: Tue, 4 Nov 2025 18:22:50 +0100 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Michael Paquier Cc: Pg Hackers Subject: Re: BRIN autosummarization lacking a snapshot Message-ID: <202511041719.wi27m4fjjveo@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <202511041648.nofajnuddmwk@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2025-Nov-04, Álvaro Herrera wrote: > 2025-11-04 16:44:47.792 CET [2118443][autovacuum worker][108/6:0] ERROR: canceling autovacuum task > 2025-11-04 16:44:47.792 CET [2118443][autovacuum worker][108/6:0] CONTEXT: processing work entry for relation "postgres.public.brin_packdate_idx" > 2025-11-04 16:44:47.810 CET [2118078][autovacuum worker][103/10:0] LOG: process 2118078 acquired ShareUpdateExclusiveLock on relation 16436 of database 5 after 1414.103 ms > ==2118443== VALGRINDERROR-BEGIN > ==2118443== Invalid read of size 8 > ==2118443== at 0x4634F39: PopActiveSnapshot (snapmgr.c:777) > ==2118443== by 0x43F693F: do_autovacuum (autovacuum.c:2561) > ==2118443== by 0x43F6E2B: AutoVacWorkerMain (autovacuum.c:1604) Ah, the problem is that perform_work_item() pushes an active snapshot before calling the BRIN function, but because of the error, we terminate the transaction before returning, so when we try to Pop that snapshot, it doesn't exist anymore. Other ways for this to happen would be an autovacuum worker trying to run an item for a dropped table (the "goto deleted2" case). Hmm ... -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/