Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lDVYM-0006g7-7S for pgsql-hackers@arkaria.postgresql.org; Sat, 20 Feb 2021 16:56:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lDVYI-0007wG-PY for pgsql-hackers@arkaria.postgresql.org; Sat, 20 Feb 2021 16:56:18 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lDVYH-0007w9-8E for pgsql-hackers@lists.postgresql.org; Sat, 20 Feb 2021 16:56:18 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lDVYC-0006aB-IG for pgsql-hackers@lists.postgresql.org; Sat, 20 Feb 2021 16:56:15 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id ECEEB5C009A for ; Sat, 20 Feb 2021 11:56:10 -0500 (EST) Received: from imap35 ([10.202.2.85]) by compute1.internal (MEProxy); Sat, 20 Feb 2021 11:56:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= mime-version:message-id:in-reply-to:references:date:from:to :subject:content-type; s=fm3; bh=26HpOy/LSAADvPA3EdUwAv7jsdmwaw/ 1CR9aKcS6muE=; b=b19QBFw9Ux/HlNACdpypmVhX4w/NG4imhtUAMlxpeCHzRfh qtxWKw62niMG07goJl0FW0CwxvNtdG4mKse1n7moMzbHUTAU/U6df4N7o8J86tq8 bbMRqE5gEr94/ViiIxlv5sYJ1pYJekwPu8tGQWpgUHsxpx5Qbpnh2sajSNvGBaPF UgpcgL5OfqLjnKJuS3/XY68TA6rXPak9l1Qz8wpHPzPXSAxQN05LOVSTuz0j/ZdL Dj/nKGOGerQ7trL9qr1kSKXdCwmfZFNuX5e0b02caEVTjgMKmEZAJj+neWpPfsGJ +a8fCdf+7nhsDQjVgsIqsMXLO2H8QHfttkPhWAw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=26HpOy /LSAADvPA3EdUwAv7jsdmwaw/1CR9aKcS6muE=; b=kvvTILHdPzDD+Ev/1fUzHp ZIIXynp6mqavAtxPrRjJTRRa3y9XFDcM5RM1rAXsINR0PYACkwrHBwLcfehHB/GD c0h+w8SVueH/4VgV17IXw9+2MBBre25JPa/xBipcJI44R5O4c16dv4+webjTcrOa +3k4IL/IBuKmicomNRlAo0sXQ27yFqMuwq1Wkv6yAkMleaIT2XiQiTQxu5YIvtwc US5IPZonhrAB/hbdNDuBceIbB9WpKhYichwAKYuM917+BCPERTZiGpAQid2DF2Je ub1+Vh2Lwc+RkF6rarFFk5CJe45OyvapinnBiCmIgLeJ+sSW+KC/Rau+u2YUjH8Q == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrjeekgdeltdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkjghffffhvffutgesthdtre dtreertdenucfhrhhomhepfdetnhgurhgvshcuhfhrvghunhgufdcuoegrnhgurhgvshes rghnrghrrgiivghlrdguvgeqnecuggftrfgrthhtvghrnhepteegvddvffeghfejteevte evfeegffduudffgedtueejvdejlefgveegudekfedvnecuvehluhhsthgvrhfuihiivgep tdenucfrrghrrghmpehmrghilhhfrhhomheprghnughrvghssegrnhgrrhgriigvlhdrug gv X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 7366E15A005E; Sat, 20 Feb 2021 11:56:10 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-141-gf094924a34-fm-20210210.001-gf094924a Mime-Version: 1.0 Message-Id: <4e2b5197-e2ec-4ecb-b4dd-0f6628f640fb@www.fastmail.com> In-Reply-To: References: <415799ff-89bb-a78e-2f79-7f29834d0460@enterprisedb.com> Date: Sat, 20 Feb 2021 08:55:46 -0800 From: "Andres Freund" To: pgsql-hackers@lists.postgresql.org Subject: Re: repeated decoding of prepared transactions Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On Fri, Feb 19, 2021, at 19:38, Amit Kapila wrote: > On Fri, Feb 19, 2021 at 8:23 PM Markus Wanner > wrote: > > > > With that line of thinking, the point in time (or in WAL) of the COMMIT > > PREPARED does not matter at all to reason about the decoding of the > > PREPARE operation. Instead, there are only exactly two cases to consider: > > > > a) the PREPARE happened before the start_decoding_at LSN and must not be > > decoded. (But the effects of the PREPARE must then be included in the > > initial synchronization. If that's not supported, the output plugin > > should not enable two-phase commit.) > > > > I see a problem with this assumption. During the initial > synchronization, this transaction won't be visible to snapshot and we > won't copy it. Then later if we won't decode and send it then the > replica will be out of sync. Such a problem won't happen with Ajin's > patch. Why isn't the more obvious answer to this to not allow/disable 2pc decoding during the initial sync? You can't really make sense of it before you're synced anyway... Regards, Andres