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 1vGKE0-00CY2O-4f for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Nov 2025 16:49:39 +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 1vGKDz-00FBAc-2d for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Nov 2025 16:49:38 +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 1vGKDy-00FBAU-Jo for pgsql-hackers@lists.postgresql.org; Tue, 04 Nov 2025 16:49:37 +0000 Received: from fhigh-a1-smtp.messagingengine.com ([103.168.172.152]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1vGKDv-005Qvo-0v for pgsql-hackers@lists.postgresql.org; Tue, 04 Nov 2025 16:49:36 +0000 Received: from phl-compute-11.internal (phl-compute-11.internal [10.202.2.51]) by mailfhigh.phl.internal (Postfix) with ESMTP id 2B3911400206; Tue, 4 Nov 2025 11:49:34 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-11.internal (MEProxy); Tue, 04 Nov 2025 11:49:34 -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=1762274974; x= 1762361374; bh=8DPNwQyj3SSxdGeo6lVB42l58ePb47CGzidiSiyt64A=; b=W lje6oZ+/r+LTJgZPXn/+AEJ1mVMgqKUI3Gt72llZIl5s87EdrJBGKrZFuPmQSGng PAkx02rCphpo0Yea7izgf64BgDux+9SGbA65MmmEGvbN9pjF9BMMjtAWUqDBfAqq K3Zh68dis7QfnADvfzO6WSoBCGByojh8vgBCBjoKRZ0Sg2fQEqqWCwBHbG5Ba5MX IrzjGdjgI6tobw7UyFVIgBd+GADGW1mBAVmOGWyoG1t61dEAmwCHcMdsFIxlKnI8 /hatdZvvgjzqg+wusihlfMig9nlqZHYy6cSHNry8mhlcRZMZefV8Bs3j4iM5rfup k+ELRnKq7HTd7wzIsJDWw== 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=1762274974; x=1762361374; bh=8 DPNwQyj3SSxdGeo6lVB42l58ePb47CGzidiSiyt64A=; b=xAMfaFo17FP/AzNNB g+U2GuQrfj4ETzyS7rnZjdv4cViA6BpCZivz4YIJy4yYWw+Z7efBU+gFb3lnjZkF 4XbHq4BYbr7LfmpgTUBVYrQoofuIM+2ugU/Cr8fkfouTNHsBlcmLBl7saTzCdYRf 8sgN+NQdVDqnQFgxasopgfwrE3p4bghrFagsdAJb5ROOGQk3hC7TDIpBY07WkroZ tZrdY6sbg7ZPFLu/mY0Wx+6+kyFL3upV7jYv7l1ZtAo5YXhMfVaSbiMXs1TOd0NE ao0eL24mgccn9+9iycebAIUzG6Nav6RetsxpxJudVp3PX0N10JwBCtbF0juv/Uvm FygWA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddukeduheegucetufdoteggodetrf 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 11:49:33 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1762274971; bh=MNm0v4V15tLRa+ZkvY0/lW1Sj7wn7EY21kSS0vV/E0g=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=ge7lXLgpkQeMRpKdwh5Mlpw+m9PDy9L0dZjCMw5zlzCkdA2xp0Fx5jiqbWhS1jQDb U0M39ZCaSqa3+sq6nDVeYEHKP1HDA3T80CA9mIapTp4/+RdaUa8aUo31XZ6+vEX7BY ZgBNQW7rdia5PnOM+vWkvfJDWJnkHEgAdSGtwWxYALBUSMc5jZezJZqAMY2G2t8tlU cF/i3EhSP4bBI4zEiYkhdO19hB24Ksjttt9fLsigTm5555iM+uG8EahfymfgRQ9kS5 8e+sVoD5HMSLGoBwFspf+lXTkaVBC87qAvvUYCptoS9IhDrZG4OGJWAYFl0C9snJsi Segx7aPU9qplQ== Received: by schmee.kurilemu.internal (Postfix, from userid 1000) id DCFEE76; Tue, 04 Nov 2025 18:49:31 +0200 (EET) Date: Tue, 4 Nov 2025 17:49:31 +0100 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Michael Paquier Cc: Pg Hackers Subject: Re: BRIN autosummarization lacking a snapshot Message-ID: <202511041648.nofajnuddmwk@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <202511041138.hqoddrfnei7w@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: > With my initial try of this test, just counting the number of BRIN > tuples, I was _really_ surprised that the index did indeed contain the > expected number of tuples, even when the error was being thrown. This > turned out to be expected, because the way BRIN summarization works is > that we insert a placeholder tuple first, then update it to the correct > value, and the error only aborts the second part. That's why I needed > to add a WHERE clause to only count non-placeholder tuples. I see that skink (buildfarm animal that runs under valgrind) has failed. Gotta vacate the premises, will study later. 2025-11-04 16:44:46.271 CET [2118443][autovacuum worker][108/6:0] LOG: process 2118443 still waiting for ShareUpdateExclusiveLock on relation 16436 of database 5 after 1016.528 ms 2025-11-04 16:44:46.271 CET [2118443][autovacuum worker][108/6:0] DETAIL: Process holding the lock: 2118078. Wait queue: 2118443. 2025-11-04 16:44:46.271 CET [2118443][autovacuum worker][108/6:0] CONTEXT: waiting for ShareUpdateExclusiveLock on relation 16436 of database 5 2025-11-04 16:44:46.298 CET [2118078][autovacuum worker][103/9:766] ERROR: canceling autovacuum task 2025-11-04 16:44:46.298 CET [2118078][autovacuum worker][103/9:766] CONTEXT: automatic analyze of table "postgres.public.journal" 2025-11-04 16:44:46.382 CET [2118443][autovacuum worker][108/6:0] LOG: process 2118443 acquired ShareUpdateExclusiveLock on relation 16436 of database 5 after 1188.860 ms 2025-11-04 16:44:46.382 CET [2118443][autovacuum worker][108/6:0] CONTEXT: waiting for ShareUpdateExclusiveLock on relation 16436 of database 5 2025-11-04 16:44:46.975 CET [2118946][autovacuum worker][110/7:0] LOG: skipping analyze of "journal" --- lock not available 2025-11-04 16:44:47.490 CET [2118078][autovacuum worker][103/10:0] LOG: process 2118078 still waiting for ShareUpdateExclusiveLock on relation 16436 of database 5 after 1017.402 ms 2025-11-04 16:44:47.490 CET [2118078][autovacuum worker][103/10:0] DETAIL: Process holding the lock: 2118443. Wait queue: 2118078, 2118946. 2025-11-04 16:44:47.490 CET [2118078][autovacuum worker][103/10:0] CONTEXT: waiting for ShareUpdateExclusiveLock on relation 16436 of database 5 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 2025-11-04 16:44:47.810 CET [2118078][autovacuum worker][103/10:0] CONTEXT: waiting for ShareUpdateExclusiveLock on relation 16436 of database 5 ==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) ==2118443== by 0x43FA9C9: postmaster_child_launch (launch_backend.c:268) ==2118443== by 0x43FDD9E: StartChildProcess (postmaster.c:3991) ==2118443== by 0x43FE008: StartAutovacuumWorker (postmaster.c:4055) ==2118443== by 0x43FF078: process_pm_pmsignal (postmaster.c:3812) ==2118443== by 0x43FF93C: ServerLoop (postmaster.c:1706) ==2118443== by 0x4401080: PostmasterMain (postmaster.c:1403) ==2118443== by 0x432A55F: main (main.c:231) ==2118443== Address 0x10 is not stack'd, malloc'd or (recently) free'd ==2118443== ==2118443== VALGRINDERROR-END { Memcheck:Addr8 fun:PopActiveSnapshot fun:do_autovacuum fun:AutoVacWorkerMain fun:postmaster_child_launch fun:StartChildProcess fun:StartAutovacuumWorker fun:process_pm_pmsignal fun:ServerLoop fun:PostmasterMain fun:main } ==2118443== ==2118443== Process terminating with default action of signal 11 (SIGSEGV): dumping core ==2118443== Access not within mapped region at address 0x10 ==2118443== at 0x4634F39: PopActiveSnapshot (snapmgr.c:777) ==2118443== by 0x43F693F: do_autovacuum (autovacuum.c:2561) ==2118443== by 0x43F6E2B: AutoVacWorkerMain (autovacuum.c:1604) ==2118443== by 0x43FA9C9: postmaster_child_launch (launch_backend.c:268) ==2118443== by 0x43FDD9E: StartChildProcess (postmaster.c:3991) ==2118443== by 0x43FE008: StartAutovacuumWorker (postmaster.c:4055) ==2118443== by 0x43FF078: process_pm_pmsignal (postmaster.c:3812) ==2118443== by 0x43FF93C: ServerLoop (postmaster.c:1706) ==2118443== by 0x4401080: PostmasterMain (postmaster.c:1403) ==2118443== by 0x432A55F: main (main.c:231) ==2118443== If you believe this happened as a result of a stack ==2118443== overflow in your program's main thread (unlikely but ==2118443== possible), you can try to increase the size of the ==2118443== main thread stack using the --main-stacksize= flag. ==2118443== The main thread stack size used in this run was 8388608. 2025-11-04 16:44:48.010 CET [2118946][autovacuum worker][110/8:0] LOG: process 2118946 still waiting for ShareUpdateExclusiveLock on relation 16436 of database 5 after 1013.910 ms 2025-11-04 16:44:48.010 CET [2118946][autovacuum worker][110/8:0] DETAIL: Process holding the lock: 2118078. Wait queue: 2118946. 2025-11-04 16:44:48.010 CET [2118946][autovacuum worker][110/8:0] CONTEXT: waiting for ShareUpdateExclusiveLock on relation 16436 of database 5 2025-11-04 16:44:48.098 CET [2118946][autovacuum worker][110/8:0] LOG: process 2118946 acquired ShareUpdateExclusiveLock on relation 16436 of database 5 after 1111.825 ms 2025-11-04 16:44:48.098 CET [2118946][autovacuum worker][110/8:0] CONTEXT: waiting for ShareUpdateExclusiveLock on relation 16436 of database 5 2025-11-04 16:44:48.482 CET [2119181][client backend][8/2:0] LOG: statement: select count(*) from brin_page_items(get_raw_page('brin_wi_idx', 2), 'brin_wi_idx'::regclass) where not placeholder; 2025-11-04 16:44:48.799 CET [2109989][postmaster][:0] LOG: autovacuum worker (PID 2118443) was terminated by signal 11: Segmentation fault 2025-11-04 16:44:48.799 CET [2109989][postmaster][:0] DETAIL: Failed process was running: autovacuum: BRIN summarize public.brin_packdate_idx 1 -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/