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 1sMZih-0037YZ-Fg for pgsql-bugs@arkaria.postgresql.org; Wed, 26 Jun 2024 20:58:23 +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 1sMZif-006iDx-R0 for pgsql-bugs@arkaria.postgresql.org; Wed, 26 Jun 2024 20:58:22 +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 1sMZif-006iDp-Ie for pgsql-bugs@lists.postgresql.org; Wed, 26 Jun 2024 20:58:21 +0000 Received: from lahtoruutu.iki.fi ([2a0b:5c81:1c1::37]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sMZic-003HY5-KC for pgsql-bugs@lists.postgresql.org; Wed, 26 Jun 2024 20:58:20 +0000 Received: from [192.168.1.122] (dsl-hkibng22-54f8db-125.dhcp.inet.fi [84.248.219.125]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: hlinnaka) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 4W8Yv96zPYz49Pxk; Wed, 26 Jun 2024 23:58:13 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1719435494; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KwBCl16fhe0i05b3+9aE7HNY8Ue7O7ftk5r6oIasjrU=; b=Xtp8Sgg5sSG9BWyetngnpBZCJ19tNL1m0edCQRhbyR8j2bWYh6IbH7oLCyeU8ChohOZwDZ Q7zavuG/NnuxW66RBiSg5vfuXykwRdhT9frlwPcXza//UgDsO5B6byPSaOIBXZsgcYHLgm Sjbrhbc/KatAWZJ/H1Lj9irBGhVoc/nyinhlF6tlFQskzop+TLrA3mV3QlBm2li+h5sd0R it8rXTwGbDldbU+Xoz0lu9pnbgHN1h9saNkA+q9QSt5IkEa4FwASfFtmah0vJ0cyza0pTB +l/13s65+oGer2PcQcNkAi4c70bzjoOLNYMj42PJsTEqiDC3y0DeNb6VFo++5Q== ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1719435494; a=rsa-sha256; cv=none; b=MTC5sbkJquYAf8pF/IEIIU7qaHMKHn7K7QJvSazftETVlgmF1wwnOLzPTubA4jKmF0xUuL 10OeUPH7gJD294akqdCvrycqX3JXhIOPucSbw364xtvfyYDFTc77VGkgSnIQEppwgjrcHH w0DrEtQA54V1Plw0RzAPYxLRAlSd+HbjxhZL/XmT9SPn2Gl1/CmuZlEQsQP1oe9nN5Dquz icGTNwhVUjD7LuObkHF5D8N3XSDOGrO8PA05p8lCSs8SDSBg0H3LeemKPbSZg84/AU7m9m 75ClEmdvYNda4FmBUhyOGTyBlmFswhkvHnZ5+xrU0v2MXO8C3Oewb88y8cs6yA== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=hlinnaka smtp.mailfrom=hlinnaka@iki.fi ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1719435494; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KwBCl16fhe0i05b3+9aE7HNY8Ue7O7ftk5r6oIasjrU=; b=KWwlfASytkLm3yYN2czBqSbSk0DHFFdzhuiWJFnbovBlyVsEXgMXkIDVlOAD8AJh5u8g7A sxT8IXXKnWKt5WQ29jPml3XNXk/8WaabWDJ1O/9mw9XTpq24SjTMOD9x+puJL3Sksb/rsH 74lsJTFoqrTpD+rR7V+9o1fz1zu2wA9uThHEnZUXGi0XgD7rfOyqFaVmsDzgdIm57vWTbj hEmEjFYrmpS/2aoLBk/SqEg1urIoac13wnf1z0JsjFZAGSKGyeIig395Sm+1xruZUl0mFB o5on6uI9YZO9KMxUuvZu4fDIE5znSWs0cUrvkaXyxvy70BptYpo1P3wVmRvZOw== Message-ID: <8e499d50-09ac-479a-b5b2-8a8bca83d057@iki.fi> Date: Wed, 26 Jun 2024 23:58:13 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: BUG #18146: Rows reappearing in Tables after Auto-Vacuum Failure in PostgreSQL on Windows To: Alexander Lakhin , Thomas Munro , Robert Haas Cc: Michael Paquier , Tom Lane , Laurenz Albe , rootcause000@gmail.com, pgsql-bugs@lists.postgresql.org References: <18146-04e908c662113ad5@postgresql.org> <9749e358-60e5-51e8-aa05-1eaf39ef339e@gmail.com> Content-Language: en-US From: Heikki Linnakangas In-Reply-To: <9749e358-60e5-51e8-aa05-1eaf39ef339e@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 14/05/2024 16:00, Alexander Lakhin wrote: > 23.04.2024 10:48, Thomas Munro wrote: >> Here is a new attempt to see what it might take to put >> RelationTruncate() into a critical section. > > When running 027_stream_regress on a slow machine with the aggressive > autovacuum settings, having those patches applied, I've stumbled upon: > TRAP: failed Assert("CritSectionCount == 0 || (context)->allowInCritSection"), File: "mcxt.c", Line: 1353, PID: 24468 > ... > 2024-05-14 12:30:03.542 UTC [22964:4] LOG:  server process (PID 24468) was terminated by signal 6: Aborted > 2024-05-14 12:30:03.542 UTC [22964:5] DETAIL:  Failed process was running: autovacuum: VACUUM ANALYZE pg_catalog.pg_class > > with the following stack trace: > Core was generated by `postgres: primary: autovacuum worker regression                               '. > Program terminated with signal SIGABRT, Aborted. > #0  __libc_do_syscall () at ../sysdeps/unix/sysv/linux/arm/libc-do-syscall.S:47 > (gdb) bt > #0  __libc_do_syscall () at ../sysdeps/unix/sysv/linux/arm/libc-do-syscall.S:47 > #1  0xb63c90ae in __libc_signal_restore_set (set=0xbe99f34c) at ../sysdeps/unix/sysv/linux/internal-signals.h:84 > #2  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:48 > #3  0xb63bb1f2 in __GI_abort () at abort.c:79 > #4  0xb6d3e2d0 in ExceptionalCondition (conditionName=, fileName=, > lineNumber=lineNumber@entry=1353) at assert.c:66 > #5  0xb6d61834 in palloc0 (size=3062661664) at mcxt.c:1353 > #6  0xb6bcd304 in CompactCheckpointerRequestQueue () at checkpointer.c:1173 > #7  ForwardSyncRequest (ftag=ftag@entry=0xbe99f7d0, type=type@entry=SYNC_REQUEST) at checkpointer.c:1113 > #8  0xb6c4b3c4 in RegisterSyncRequest (ftag=ftag@entry=0xbe99f7d0, type=type@entry=SYNC_REQUEST, > retryOnError=retryOnError@entry=false) at sync.c:605 > #9  0xb6c48e62 in register_dirty_segment (reln=reln@entry=0xb8ec75a8, forknum=forknum@entry=MAIN_FORKNUM, seg= out>, seg=) at md.c:1369 > #10 0xb6c4a0c6 in mdtruncate (reln=0xb8ec75a8, forknum=MAIN_FORKNUM, nblocks=45) at md.c:1229 > #11 0xb6c4abe8 in smgrtruncate (reln=0xb8ec75a8, forknum=forknum@entry=0xbe99f86c, nforks=nforks@entry=2, > nblocks=nblocks@entry=0xbe99f878) at smgr.c:743 > #12 0xb6a3e8c6 in RelationTruncate (rel=0xb2e969a0, nblocks=nblocks@entry=45) at ../../../src/include/utils/rel.h:574 > #13 0xb69b8042 in lazy_truncate_heap (vacrel=0xb8ee8f38) at vacuumlazy.c:2642 > ... This should've also been fixed by commit b1ffe3ff0b. Thanks Alexander for pointing me to this thread! -- Heikki Linnakangas Neon (https://neon.tech)