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 1sNVEm-008z87-8f for pgsql-hackers@arkaria.postgresql.org; Sat, 29 Jun 2024 10:23:20 +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 1sNVEi-008xBU-Iv for pgsql-hackers@arkaria.postgresql.org; Sat, 29 Jun 2024 10:23:16 +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 1sNVEh-008xBK-O5 for pgsql-hackers@lists.postgresql.org; Sat, 29 Jun 2024 10:23:16 +0000 Received: from fhigh7-smtp.messagingengine.com ([103.168.172.158]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sNVEZ-003hAf-HP for pgsql-hackers@lists.postgresql.org; Sat, 29 Jun 2024 10:23:13 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfhigh.nyi.internal (Postfix) with ESMTP id E3B3A11402CB; Sat, 29 Jun 2024 06:23:05 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sat, 29 Jun 2024 06:23:05 -0400 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-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1719656585; x= 1719742985; bh=2eKh/IC7aGweuqnTq5IvL05YEhttdNezltTIUM95LT4=; b=L TtvEs9KpoFi+EHQOMSAWlGKCvkBxM9k+UXOaL05ccVmyFXS9tdlMxjEDKnUx47MH D1w/wzIxb6FR/Z/Z5xdUwhPP+5+moNvFE1jUuBVNYU5nVcz55z0n17CCZv3rJeFu UQvIZNIXNSbov9BWS2sw/w9IaNE5vu6I3Lhk0lguCltPeS1V9drf0uyCTP/1EoT/ uV9WdqJpFfwCv7i/DxEHvldooAS2xaGOtkxmzsotvpyBIK0nE92eZ/YqmkHleHOG A7k9FqRpqdAjsxeuSDLn/GTUc+EUJ6+Iz4ezV03lNX/ftogqEmSHsYoO9te5Pyy1 FxpeijVSVxGPtMkq7ngHw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrtdelgddvkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpedvkedtffduffdtffffheffhfejjefhgfeiueeukeejkeff gfdufffhudffffeuveenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhh vghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 29 Jun 2024 06:23:04 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1719656582; bh=45dolp3TIkfq8DdQghsBrntZjgpSlHQU20GlM5ahrkc=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=WyvGzGw2ag/lL2+1Bd1JwOtZmHfTIdYM1drntZ9AkKznLkqjqQccwCfVtns870pRO aM7bFFmuqt5tqu5H0YhMStC7DLloRRaaFXXY/Pfo0cZXkvQqXebxLuUxcp0tLvydAg 3oO5oSui54DH+Cl8JZ50cMr9OUKLOEaMrwBJfUpxiA5nLig4rhjtSywuY0vF/Cw2OT 1iqwae7Qbu65+HDiszaqgTgHHo6XPl8DzPe9RNMzQTuD+nJzmAQ6fkWZnZyChpe5zN UiFs5+tNtiQ/lsbdhOTFBUsURqT7JiC66Lh8C//pbly1HgklF9tGYoWAgb0A0539ie zIvdFy582Lpbg== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 159C352B; Sat, 29 Jun 2024 03:23:02 -0700 (PDT) Date: Sat, 29 Jun 2024 12:23:02 +0200 From: Alvaro Herrera To: Alexander Lakhin Cc: Bharath Rupireddy , Tom Lane , Andres Freund , Jeff Davis , pgsql-hackers@lists.postgresql.org, Jaime Casanova Subject: Re: LogwrtResult contended spinlock Message-ID: <202406291023.6plsxeg2zho7@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <36796438-a718-cf9b-2071-b2c1b947c1b5@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi On 2024-Jun-29, Alexander Lakhin wrote: > ----------------------------------- stderr ----------------------------------- > TRAP: failed Assert("TYPEALIGN(8, (uintptr_t)(&currval)) == > (uintptr_t)(&currval)"), File: "...\src\include\port/atomics.h", Line: 597, > PID: 7556 > child process was terminated by exception 0xC0000409 Oh. This is the new assertion in pg_atomic_monotonic_advance_u64() and therefore the only possible culprit could be logInsertResult in XLogCtlData. Does it work if you do this? diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 8dcdf5a764..e581488d57 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -468,7 +468,7 @@ typedef struct XLogCtlData XLogRecPtr lastSegSwitchLSN; /* These are accessed using atomics -- info_lck not needed */ - pg_atomic_uint64 logInsertResult; /* last byte + 1 inserted to buffers */ + pg_atomic_uint64 logInsertResult pg_attribute_aligned(8); /* last byte + 1 inserted to buffers */ pg_atomic_uint64 logWriteResult; /* last byte + 1 written out */ pg_atomic_uint64 logFlushResult; /* last byte + 1 flushed */ Thanks -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "Use it up, wear it out, make it do, or do without"