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.96) (envelope-from ) id 1vaVsS-009eul-26 for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Dec 2025 09:18:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vaVsR-003cz7-1E for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Dec 2025 09:18:52 +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.96) (envelope-from ) id 1vaVsR-003cyx-0F for pgsql-hackers@lists.postgresql.org; Tue, 30 Dec 2025 09:18:51 +0000 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vaVsP-003Xct-0H for pgsql-hackers@lists.postgresql.org; Tue, 30 Dec 2025 09:18:51 +0000 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-8035e31d834so7278556b3a.2 for ; Tue, 30 Dec 2025 01:18:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767086327; x=1767691127; darn=lists.postgresql.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=J2REp/gBVokO8PyGhVOQrBtNi2Xr00OiPPQasR+E/Sk=; b=XnereWKyQg0eXfZHNwOM1v79p0UNqwHWgv9bRrVFgnbsbLqb8l2WOZYceQGiIScZqY Kb+mk2ueu2jGA4QvX4cChJyH7KFbWplxPQ2FLQcn5Nn1mVVB7VgadaLNHB/42aCYc9Yg qqpV7GrXVG68KMLfnhEsa0x+vJuXCea+GAsQG9u8f/iOIOFrjhcorEr9PzJDzlvfZdHD W41FAjdQcxTMNfZ7Sbz1R5gz1jod7Q89bks4WNqBKS27wViMm7Zmf+5aBAgvN94nOS0d JHMSqQRyd5vyGhvy234PGF26YJ6roIFRqnxlT5caUMYiuRyRfONnEmArs4mXvLGKpC+I QGTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767086327; x=1767691127; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=J2REp/gBVokO8PyGhVOQrBtNi2Xr00OiPPQasR+E/Sk=; b=YLW/LqI7+bU4tdElE/B9lmQSABGXArMICilUsid2RCOKhqwtNiN2kUbJgOcsgFeO0i Z2pUW/O7Edez2oxuYNdX+v1pVCws6t1xmCOsdx/L7Ulc6s8GY7d5T8f7CdtAZa6/iAw5 v6V9t2Zgsf5VODollOxJMBtAkXqZ/wywEe897+FjbKmp0TdI3U1LWSdGDTBQM5KS8H+x f7zN5pGsK+GOrOcRVs1MJjloqe9gKOkyyKdXL8Auxnp75qdcS0uau2uaAvEHI9+VVwz3 Xwl5Gv1Vrum1frZwkbjwFtyBCOTQ143igCuLT4IYd5opQvs7C7YfE3VIf1SgIrWesNlL /eqA== X-Gm-Message-State: AOJu0YyGwcPmkiB/HooThIeUUtxXjg+wHgxqEGN2OHpwyZF10uTC4D74 G/1iP6UBEIEPSMk/sslguo5F+pQi+CS8Ebg7rLnOWYjH3CKS3k1owJ5bLoDE2uyH X-Gm-Gg: AY/fxX7tFVarK/Jmxs37GH8JcI2IWlI6sDM7hfgMAhjz0vq0vQVqByWOPX4/6lvL4yw HbQ8XXst9b7r8jngrtb7bzLJlj444011G2kvZW7/fKQJd3MkKzm/scHrZnQ2KjltRBC9zb7/uXH xDrRBO+pG2d33Dvyyr1xrm6OtAYrsZNGtP1HJhm5Gtp+026bT8QWmLP6HtRBznnBY2YF2JOqEeL G8/9vBz1k7YXrU63sapVh9t1oDKQkndXTRBQVeqvXLv1UMF5j6y1z9UY5EHtj60/lezpynvoSgw Al6N2pwjbQzbiXK9+4SmUgryDbs8PokiNcq377WO9dAUashO/Pz2ApyzjcxHrXfa0VAYOYGjkVf 5YINr4FgVpn3KzjUZ1b9A6DVKtTe1D2fTj1GzGFUQB4EuUoi9RYPGJM+SVgn+5BgoDJlIn3qxoP XnKycb0YImYa/eJx0armx/ X-Google-Smtp-Source: AGHT+IG+M3SS173U+OFhVPp+S/0RLFbAb2QkUBz7daakkHBVgj40Xh0FJ9HXDZkJk4g6Nx7irRp2Mg== X-Received: by 2002:a05:6a20:12c9:b0:34e:e0ba:7ab with SMTP id adf61e73a8af0-376aa4fc463mr35509940637.40.1767086326726; Tue, 30 Dec 2025 01:18:46 -0800 (PST) Received: from smtpclient.apple ([185.135.79.161]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7ff7e48cea1sm32410492b3a.45.2025.12.30.01.18.45 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Dec 2025 01:18:46 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81\)) Subject: Re: Wrong comment for ReplicationSlotCreate From: Chao Li In-Reply-To: Date: Tue, 30 Dec 2025 17:18:10 +0800 Cc: Postgres hackers Content-Transfer-Encoding: quoted-printable Message-Id: <00DB978B-828D-44FE-8A0B-1643CE03878E@gmail.com> References: To: Daniil Davydov <3danissimo@gmail.com> X-Mailer: Apple Mail (2.3826.700.81) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Dec 29, 2025, at 21:39, Daniil Davydov <3danissimo@gmail.com> = wrote: >=20 > Hi, >=20 > I noticed that the comment for ReplicationSlotCreate function contains = this > description for the "two_phase" option : >=20 > * two_phase: Allows decoding of prepared transactions. We allow this = option > * to be enabled only at the slot creation time. If we allow this = option > * to be changed during decoding then it is quite possible that we = skip > * prepare first time because this option was not enabled. Now next = time > * during getting changes, if the two_phase option is enabled it = can skip > * prepare because by that time start decoding point has been = moved. So the > * user will only get commit prepared. >=20 > But commit [1] introduced the ability to alter the "two_phase" option = for the > replication slot. Thus, I guess that the comment mentioned above is > outdated and we should change it. >=20 > [1] 1462aad2e4474ab61174f8ab00992cd3d6d57c7b >=20 > -- > Best regards, > Daniil Davydov > <0001-Fix-comment-for-ReplicationSlotCreate.patch> The old comment claimed =E2=80=9CWe allow this option to be enabled only = at the slot creation time=E2=80=9D that is no longer true after commit = 1462aad2e4474ab61174f8ab00992cd3d6d57c7b, so yes, the old comment need = updating. But I think the updated version is too simple. It loses the information = that enabling two_phase later can result in missing PREPARE. So, I would suggest something like: ``` * two_phase: If enabled, allows decoding of prepared transactions. * Note that enabling this option after decoding has already advanced * may result in missing PREPARE records for transactions that were * prepared before the option was enabled. ``` Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/