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 1vcBDt-002mxm-2U for pgsql-hackers@arkaria.postgresql.org; Sat, 03 Jan 2026 23:39:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vcBDs-00EEul-1n for pgsql-hackers@arkaria.postgresql.org; Sat, 03 Jan 2026 23:39:53 +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 1vcBDs-00EEud-0p for pgsql-hackers@lists.postgresql.org; Sat, 03 Jan 2026 23:39:53 +0000 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vcBDq-004KR8-1E for pgsql-hackers@lists.postgresql.org; Sat, 03 Jan 2026 23:39:52 +0000 Received: by mail-pg1-x533.google.com with SMTP id 41be03b00d2f7-c0c24d0f4ceso7562804a12.1 for ; Sat, 03 Jan 2026 15:39:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767483588; x=1768088388; 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=srA0f6LYNwdy1e3NVq5jagXLCweKVDSd5EZy7CG9e90=; b=THLkGJG/pe9swgh5lKZHwo2zDVnwZeZjOcWaSx1mwit6GouzDS6PMZpWINu5PIZXGA uBM/MXEs1CXo6NXx5R9qfFkZdB6+RMAx1hVhCKxDFXqq7TAzZdQkyG0rSvmQrXYfN3xO UIsNxnfgnZJUM1Szqjilm5L6vpb76h7l7OH4K3W2THdOikai2Bla3kvTg1tucnsHIYYR WAfrb3F9QRbzmh08OEHe4grAretM4hjToAHHIzcP0a5i6UNr7umNtpw9gSi6COy93nra vKYRiwW7QCRydqhXH3tA6UpaIgtXKoKuDCHq49OZMQG7xZTQRfnc+UVDWGuoTgpt3yZm r6Jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767483588; x=1768088388; 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=srA0f6LYNwdy1e3NVq5jagXLCweKVDSd5EZy7CG9e90=; b=kfrX5kFlKHN3XkdODMoezvfoSPzUO1LtJQlPC6FZGR1oRnldDXmdvZTDVqSBLEM70Q G2MkPIbk+x0nfbjv6TtQMQkYNzifcF4suTrRQojJe7eW+A9Qkzxg29UZ1ijhCkWqLZAE R6/D29K/50L5XiQr+ndY6gAuBX9Se9yX6kf6mZF8UR8WMu/GOfl6D5NjMKByfQ4+XOi5 4AHo0q3/jBUKnmmgL887iEuFYU6HskjyfDb13XCYAY/tOwXqaPFrYvViVagE4gErm42K vJXHWANFcuJSxnHl0VvVJHSlUN8KkS4grwG7H+Gm3IiDUZ8OGBPUOuL0sfhJ9I2e7Zsg /H3A== X-Gm-Message-State: AOJu0YymXBMBne7+Q5usZXSY9Dfr+1P5TMuQFPWeeBvgmL7hBxFpKp5x 9VX/rV4P9YjMFOMS0RKLL22kHzhXOK91kX9/x7lo4TChOz67vdOsU1e1qSLsxcHWQzU= X-Gm-Gg: AY/fxX46GMHOxCYTsLQTnQRygS0W0FDbSyGPtHi7BoyTGHWPYuC3tLTcleko2rL2rvu kboVjPZas2v7I2M6rCTBP0axmtD1IFjkmOFDItS0e7kXXKz7mOM9GrsDs4gGUWcZpm9s/hMEp35 IQQZTEuvmSRa8K6tPgGfzcDomCpYvy+pb8KOJXmuaZIHSyAAQzX8e9/jZLwK94Hkqn3kJ6vHZtx OspHDjFKIJ7EfESu4HkDIrRWrxgOdilOSsFHOCiJ5P0cWtmvGz4Cs4I+cwhioOrjizoM6MnPp8r ITEQXmvuGYVkyq7B8/GP4zXzVTuxsT1laja4Nu9IIn9Mql9rf6S52u2PX4W87tFHhNSLqn7WPi7 s2Kga8+ME9uN9iVVWfl2BILZ4Pu6/t16eP/rEemKqcJzzJT9gent1mlWLFizMlzrL3Dlq6X6dHf KEadyfQJIw4ciJ28sAZoAM X-Google-Smtp-Source: AGHT+IF93V3kSKwwnE/iH401R9wJfCmndmijEyUYABtbiQdqPpgqZ16kPHvt1bzdH/9wawIK2jWWiA== X-Received: by 2002:a05:7300:a92:b0:2b0:bd77:7ba2 with SMTP id 5a478bee46e88-2b0bd777c0bmr15332064eec.35.1767483587987; Sat, 03 Jan 2026 15:39:47 -0800 (PST) Received: from smtpclient.apple ([142.171.105.12]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2b140c42e7esm6034975eec.22.2026.01.03.15.39.46 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Jan 2026 15:39:47 -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: Sun, 4 Jan 2026 07:39:13 +0800 Cc: Postgres hackers Content-Transfer-Encoding: quoted-printable Message-Id: References: <00DB978B-828D-44FE-8A0B-1643CE03878E@gmail.com> 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 Jan 2, 2026, at 00:31, Daniil Davydov <3danissimo@gmail.com> wrote: >=20 > Hi, >=20 > On Wed, Dec 31, 2025 at 9:32=E2=80=AFAM Chao Li = wrote: >>=20 >> You=E2=80=99re right that during CREATE_REPLICATION_SLOT, = SnapBuildFindSnapshot() ensures we don=E2=80=99t miss PREPARE records = for prepared transactions that exist at creation time. >>=20 >> 1462aad2e introduced support for altering logical replication slot = options, including two_phase, after the slot has been created. The = commit comment says: >> ``` >> Changing the 'two_phase' option for a subscription from 'true' to = 'false' >> is permitted only when there are no pending prepared transactions >> corresponding to that subscription. Otherwise, the changes of = already >> prepared transactions can be replicated again along with their = corresponding >> commit leading to duplicate data or errors. >> ``` >>=20 >> true->false is not allowed, however false->true is permitted. So, I = think the old comment is still possible today: >> ``` >> * 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. >> ``` >>=20 >=20 > Hm, I still can't understand why the comment that you provided is = correct. >=20 > How can we "miss PREPARE records" if slot creation requires all = prepared > transactions to finish? The commit message says about risks during the > change of the parameter "on the fly". But we are dealing with slot = creation. >=20 > -- > Best regards, > Daniil Davydov No problem, maybe I am wrong. Then please ignore my comment and wait for = other review comments. Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/