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.98.2) (envelope-from ) id 1xMKhS-00000001yQ6-0nKY for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Oct 2026 07:37:26 +0000 Received: from localhost ([127.0.0.1]:57262 helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xMKhQ-00000003E9K-38U4 for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Oct 2026 07:37:24 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]:38264) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xMKhQ-00000003E9C-1uYY for pgsql-hackers@lists.postgresql.org; Thu, 29 Oct 2026 07:37:24 +0000 Received: from mail-pj2-x06.google.com ([2607:f8b0:4864:39::6]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1xMKhO-00000001YIN-1nRA for pgsql-hackers@lists.postgresql.org; Thu, 29 Oct 2026 07:37:24 +0000 Received: by mail-pj2-x06.google.com with SMTP id 98e67ed59e1d1-3ad41dad3faso1203168a91.1 for ; Thu, 29 Oct 2026 00:37:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793259440; x=1793864240; darn=lists.postgresql.org; h=content-transfer-encoding:content-type:in-reply-to:from:references :cc:to:subject:user-agent:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to:content-type; bh=U5T5xzUv/NdISDunOvqEX18sl+oOF8NVwT9FRRbGuUk=; b=cR9jA/BFx7XkBs41tmee2c6HTJqefirEU46T0sVP1h86xRawRh0qp1U2zaSlSkm0GS H285JVFx/uy9k3KFVJnP0UJ3ItvcUL/F8tdMNCj8bju0BZ6wRs/JDZmtaSfATPj9VuIr 6vNV9yWTMBgbwbb47Hq/WJEdOUlqUaSe61QslYeEa9VgHHor92RwkpnhjAlo35mxbNe2 T//p4HZ76i6qAa3ttBtf97GctxyBoQjZWgIFUpwd06N3wY4MU5dResPER4wvX0SP6912 /917be1QrqHY9V9b7FHK8LNkNhMQFYUXtr5AVhbnfdTqtnAyothST6ondk2UWmNOtFbb +dBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793259440; x=1793864240; h=content-transfer-encoding:content-type:in-reply-to:from:references :cc:to:subject:user-agent:mime-version:date:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=U5T5xzUv/NdISDunOvqEX18sl+oOF8NVwT9FRRbGuUk=; b=RUvCKS1fYdGUQeqP2+7ovDPJo0L2dO2epmXWUGXRvGMJ3lOAekHxHBUaHdgbK2QaZd KUCGXsf082WZcIgJIrigUd8UubTHSsNs2DT6VR3l/RPTGM08O/Jyyt6dmG4Tz5K2TTNH o8+Ig8Oh3E36cc9ytaN/QiM6APRNaZZmluqtP72PVNyHcCphmLKu2mrTPPvKNw62ijR7 CQN1Arr+Lywpqrt5A0+9ciSMDTiSgkMe0p/UXoOT5CpEwPiN/ADIGKJD8ZrGEp7dXzKH rUI8yD1nhfsHA6Y8L9KE/hf5V1YYA8oant12ODueon8YdIWhwaO17DqdgmjHYjQKbTjd kJkQ== X-Forwarded-Encrypted: i=1; AKwUvBwLLKmfoA5tdTgxVFmbduFLSgKbKJxzB+0iM93TDL0UxYj8ucwnj1QRj6P9XyvgBeSoLShcn71FyanwxO6X@lists.postgresql.org X-Gm-Message-State: AFq9FYKQvvCgHyFeG81ncyaQHAeGhmSffVep51mgiLVNMkSISnvN1Li6 Rs8fBCh+0Tn9O7XWWPIBWWm74U9gs6wIp5QvMyO45NLVrgwhJftxa8nH X-Gm-Gg: AYBFou1GuDuVIjgrB/VJQ2f6finYTUjycJwX7K2ZTwXxYqbZv6RWzt3JIl8581K/vnW p5DMOetoZPH9IDPWnvUtI+VKTwbWj0hXDM+WOrHzx3ZM423BN0EHjwPwlft6GPUSdRYJXeOZROv 1TqYB1CfrArvK/rVX0oOsf5Zb4vNXkARYQnDAD0ON5eDyYN615KrhzkPIJ3NENtrJQDFxDpua0d c4bTS0+R6Lvhc10qZTjOVWlR6ZEE9qTEmuNONHCWq/zTOVf8AUkUqyrDEg75RDiIvI8VMNpK/m0 xUzb3eOBpZ4cU+BkHA12g5eOrp4TU5vyyO5ZtcivLPo2IkRw54Rp4vg34q8d401BlC/S6fMK4Qx XetFTJ/aZjBWfybZYTho1ADfZmEg4mDZcusj5uSIji+AdvjfJkrlVuidiwPrV8CIVgM51+0GNGg 4LFMGvZyVYr23EteISfclYGqiyNG3U/OBStbl0a8plAsAem5gNLvtqiF7pTWus5Kk20+BmanWyB MZ2Ly8SsDkB7r2ryXS+zn3qzKYfPTN6prZ6JuYCaxlI/QkPC8N5y7qXV35+IymTIbxeGd4Z5Aco Hw76qNqs5S3CDPZ18HcuAOAtlwIzbEzrh5LupV2D6v/X8z4jkvqzXWxzjUMKlYs183gdDrXwNzt 24fHPPE14l2Myz0iL3BczlzH7jhq9O3MqB668Tnoqqz7+BEdtzuDDlaQMGR9ChEeFQOH3tA52Uo Pf5T5b3d6MhqYAdhsTGqgFgpgFhesHw/8n X-Received: by 2002:a17:90b:5845:b0:3a6:e99b:bbdb with SMTP id 98e67ed59e1d1-3ae58308377mr3620243a91.50.1793259440193; Thu, 29 Oct 2026 00:37:20 -0700 (PDT) Received: from ?IPV6:2400:79c0:20d:182:b91d:d568:d39:ad4a? ([2403:300:600d:d82:c5da:d568:d39:ad4a]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3ae6e8fb2fesm2944848a91.4.2026.10.29.00.37.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 29 Oct 2026 00:37:19 -0700 (PDT) Message-ID: Date: Thu, 29 Oct 2026 15:37:15 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Avoid resetting subscription two_phase state to pending when already enabled To: "Hayato Kuroda (Fujitsu)" , "pgsql-hackers@lists.postgresql.org" Cc: "amit.kapila16@gmail.com" References: <8e85abdf-738b-4578-ac42-4dc8eaa061dd@gmail.com> From: Zhijie Hou In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Thu, Oct 29, 2026 at 03:29 PM "Hayato Kuroda (Fujitsu)" wrote: >> While reviewing another logical replication thread, I noticed an issue >> with altering a subscription's two_phase option. > > Good catch. > >> I think we can fix this by not resetting subtwophasestate to PENDING >> when two_phase is already in the ENABLED state, as shown in the attached >> patch. > > +1 the fix, but I have a quick confirmation. > > Assuming that twophasestate is 'e' and the user runs ALTER SUBSCRIPTION SET > (two_phase = on). In this case all attributes are retained as-is but update_tuple > is set to true anyway - CatalogTupleUpdate() would update the tuple with the > completely the same tuple. > > But I feel it's acceptable because 1) it rarely happens, > 2) conflict_log_destination option has the same issue, and 3) fixing it may > need wider changes, like setting update_tuple in the if-statement, thought? Right. This is the same as all (or most) subscription options and even other object options like publication options have the same behavior, since we don't compare the new value with the old one in most cases. So I think that's an independent topic. -- Best Regards, Zhijie Hou