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 1tArMy-000UOO-Ug for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Nov 2024 13:55:48 +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 1tArMv-006cK7-KM for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Nov 2024 13:55:46 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tArMu-006cJy-Ii for pgsql-hackers@lists.postgresql.org; Tue, 12 Nov 2024 13:55:45 +0000 Received: from fhigh-b8-smtp.messagingengine.com ([202.12.124.159]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tArMq-001Xwi-Qc for pgsql-hackers@postgresql.org; Tue, 12 Nov 2024 13:55:44 +0000 Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfhigh.stl.internal (Postfix) with ESMTP id C8669254015F; Tue, 12 Nov 2024 08:55:39 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Tue, 12 Nov 2024 08:55:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1731419739; x=1731506139; bh=IN6Rp42tYu lJpZ8C1rnpL0rSHhA5e4NT5y2eMuoHVtU=; b=JvDUtZ9wf7wbAGptLd4Sm13iH+ kbZO1UaPOSpto+hlODV53sO3tfblcOMqdgHnxWpdS4QctuvnnxNWHw66LbKilnNV +Q9W/w5KpX2vm/kubH9CIqyDQy+kv7kuUlhzgiQLeRwVb1PJQ5wJar9ZNY3cxd2U JtXPOtYSHbpFXkKVBT6Ul55C4okRfHl04ZR06wOR249eyrxMNerf2C6F9flsuQlr /o1b7QpMI+humMnLyFcNYuUYHKni+YyLuBUZ/cC94pby2thH5DoKOVYey7UAApVk e+DK5FZoRQIZA9sCVV/KTMqVkbPmbmNT4l4Y+w3VgGGS5aGH+3E84Udl+IfQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1731419739; x=1731506139; bh=IN6Rp42tYulJpZ8C1rnpL0rSHhA5e4NT5y2 eMuoHVtU=; b=Js4yRgLMhWlyiGELnx7zrKxXOchlFp4/yLNDdGlJN5MJNn+VJUp xSQh+QyQDB35LsWqUz1UOKMxD2QPgIxizVjfoX3MX+QkOs4VToHx5XBbIjeHIpM8 TmA/30Yx+fbZNanYJ43gsLGa/EMbZ+uENLSfXBE9/PrUCPCmcL9xHTvJdzRmI/rl 5XWAtvjD2wZaueCXODniZTkOf8a4Yj8lgXPqhgR62sirjTWWR8ZQwhvXS69C8rkH RB+J3eLaftuWEvkQHtuUaawtTNSBG8Jz0Lk00OS3ATkYfBsl6JTS/IHlVyV8lqPb CCgMFH8F4jAmq8pagomQXWXDj3uEd2jyFhw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudeggdehgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpeffhffvvefukfhfgggtuggjsehttdfstddttddvnecu hfhrohhmpeetnhgurhgvshcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlh druggvqeenucggtffrrghtthgvrhhnpeeffffgledvffegtdevlefgtdeggffhvdekgfeg teeiveejkeetudelveejhfeugeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpegrnhgurhgvshesrghnrghrrgiivghlrdguvgdpnhgspghrtghp thhtohepjedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohephhhouhiijhdrfhhnsh htsehfuhhjihhtshhurdgtohhmpdhrtghpthhtoheprghmihhtrdhkrghpihhlrgduiees ghhmrghilhdrtghomhdprhgtphhtthhopehshhhvvghtrgdrmhgrlhhikhesghhmrghilh drtghomhdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehpohhsthhgrhgvshhq lhdrohhrghdprhgtphhtthhopegrlhgvkhhsrghnuggvrhesthhimhgvshgtrghlvgdrtg homhdprhgtphhtthhopehtohhmrghssehvohhnughrrgdrmhgvpdhrtghpthhtohepjhgr nhesfihifegtkhdrihhnfhho X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 12 Nov 2024 08:55:38 -0500 (EST) Date: Tue, 12 Nov 2024 08:55:37 -0500 From: Andres Freund To: Jan Wieck Cc: Amit Kapila , Tomas Vondra , "Zhijie Hou (Fujitsu)" , Aleksander Alekseev , pgsql-hackers , shveta malik Subject: Re: Commit Timestamp and LSN Inversion issue Message-ID: References: <9f7f4def-7ea8-4ad3-83e7-a8cc9d18c58a@wi3ck.info> <11ee3489-40ba-45d6-ba6a-7c3def725e84@vondra.me> <00f7cfb2-e3a6-4bd7-b19c-fd75d3838049@wi3ck.info> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <00f7cfb2-e3a6-4bd7-b19c-fd75d3838049@wi3ck.info> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2024-11-12 08:51:49 -0500, Jan Wieck wrote: > On 11/11/24 23:21, Amit Kapila wrote: > > As the inversion issue can mainly hamper logical replication-based > > solutions we can do any of this additional work under spinlock only > > when the current record is a commit record (which the currently > > proposed patch is already doing) and "wal_level = logical" and also > > can have another option at the subscription level to enable this new > > code path. I am not sure what is best but just sharing the ideas here. > > It can indeed be reduced to one extra *unlikely* if test only for commit > records and only when WAL level is "logical". Without those two being true > there would be zero impact on ReserveXLogInsertLocation(). No, the impact would be far larger, because it would make it impractical to remove this bottleneck by using atomic instructions in ReserveXLogInsertLocation(). It doesn't make sense to make it harder to resolve one of the core central bottlenecks in postgres for a niche feature like this. Sorry, but this is just not a viable path. Greetings, Andres Freund