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 1pkPFf-0003c4-QH for pgsql-hackers@arkaria.postgresql.org; Thu, 06 Apr 2023 13:02:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pkPFe-0007of-Oh for pgsql-hackers@arkaria.postgresql.org; Thu, 06 Apr 2023 13:02:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pkPFe-0007nP-Fd for pgsql-hackers@lists.postgresql.org; Thu, 06 Apr 2023 13:02:06 +0000 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1pkPFb-001FZm-Et for pgsql-hackers@postgresql.org; Thu, 06 Apr 2023 13:02:05 +0000 Received: by mail-wm1-x335.google.com with SMTP id v14-20020a05600c470e00b003f06520825fso2839012wmo.0 for ; Thu, 06 Apr 2023 06:02:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680786122; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=4YqFnVKqXEQmOL37vJBhM5XAeTayu0Nl5bUfahrUciI=; b=cDxcamjuc9lGYdgDnOQYpjfeUEd8OQrL8ZkFLRVX61aIvtCuGIdoZMkVVljNOmhkyK 7efoW6WcSxosMfOQring9xSImHwk+Qk5DEX44rllAnLx7Thdux87el5KWRdZ87pju9RU Re66VeNMhQg4dAH+k56uXXPB3TjKXahpTEcn2f0c+MLZD1lIOmkyZm3aNmM3Pe0Yex9X YzkuQs8FIHgi+GqZhwwSJ8Kixqkuce9rQLl9X7o/8s6q/1HLx+sKZdaExD9VPWmaJ+7O 3QIAGYIG7lAv4ZO/in+5j+juFTVG7PQtRCUHn5rH/CjkDkoLO9dDmBVFMYNAwI6D1mp2 mjow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680786122; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4YqFnVKqXEQmOL37vJBhM5XAeTayu0Nl5bUfahrUciI=; b=0358wo14p2FXCg7cN/UWF4UcMW47ZAdmg+o51U4KbYP2QM54AwvyoKluAAKavg7l5l ZwckpLQQ8WyqntHDTCITLBkAPfd5u5qcGVKrmoLrux7UBVKDNRV3ZzejCLTec2Y6Sweq dOOBw94lWmQCnLLcfb6z92omABIw06ijFnJ0uA3yrOUW4qZP5yHDM+UdFqVBXqRB/RRk YbH305G70ibNhmPANvO4LC2skKBFAjHUUSVjgUyHuNhZAZzpM+Um6AF/8XeLmiEOiJ9r /FyQxUfpfuZsOnbRcAFzvxHndzqY4WBRPW68fx8QLG2dUUJcG0WhE6jXapdFNvXRIXTA bEdg== X-Gm-Message-State: AAQBX9fBMFqa/ZYPOZjHdY0SWju1unxYEUzyJqAYCEmPVy3DByeGVO94 dcWM3Cxi1zdfqut2+p6w1/0= X-Google-Smtp-Source: AKy350brnqBBd5veV91fNqYfsSmQP0g0DAr8DF/rsbeJkToS9fVpItd+azXtXUqEdr1+Q3kAi0liAQ== X-Received: by 2002:a7b:c40b:0:b0:3eb:395b:8b62 with SMTP id k11-20020a7bc40b000000b003eb395b8b62mr6933156wmi.39.1680786122161; Thu, 06 Apr 2023 06:02:02 -0700 (PDT) Received: from [192.168.0.121] ([54.239.6.190]) by smtp.gmail.com with ESMTPSA id t6-20020a7bc3c6000000b003f04646838esm1549273wmj.39.2023.04.06.06.02.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 06 Apr 2023 06:02:01 -0700 (PDT) Message-ID: <1903ca9b-1dc9-20a6-404a-d4c460c7bdcc@gmail.com> Date: Thu, 6 Apr 2023 15:02:00 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: Minimal logical decoding on standbys Content-Language: en-US To: Amit Kapila Cc: Alvaro Herrera , Jeff Davis , Andres Freund , Robert Haas , Thomas Munro , Ibrar Ahmed , Amit Khandekar , fabriziomello@gmail.com, tushar , Rahila Syed , pgsql-hackers References: <20230330095449.47yz2q4mn27t6xgl@alvherre.pgsql> <68a47e4c-f4bb-45ae-28be-938af60b203c@gmail.com> <8c6e7670-3914-35d1-7977-34f60e598477@gmail.com> From: "Drouvot, Bertrand" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 4/6/23 11:55 AM, Amit Kapila wrote: > On Thu, Apr 6, 2023 at 12:10 PM Amit Kapila wrote: >> >> On Wed, Apr 5, 2023 at 9:27 PM Drouvot, Bertrand >> wrote: >>> >> >> Another comment on 0001. >> extern void CheckSlotRequirements(void); >> extern void CheckSlotPermissions(void); >> +extern void ResolveRecoveryConflictWithLogicalSlots(Oid dboid, >> TransactionId xid, char *reason); >> >> This doesn't seem to be called from anywhere. >> > > Few other comments: > ================== > 0004 > 1. > + * - physical walsenders in case of new time line and cascade > + * replication is allowed. > + * - logical walsenders in case of new time line or recovery is in progress > + * (logical decoding on standby). > + */ > + WalSndWakeup(switchedTLI && AllowCascadeReplication(), > + switchedTLI || RecoveryInProgress()); > > Do we need AllowCascadeReplication() check specifically for physical > walsenders? I think this should be true for both physical and logical > walsenders. > I don't think it could be possible to create logical walsenders on a standby if AllowCascadeReplication() is not true, or am I missing something? If so, I think it has to be set to true for the logical walsenders in all the case (like done in V62 posted up-thread). Andres, made the point up-thread that RecoveryInProgress() is always true, and as we don't want to be woken up only when there is a time line change then I think it has to be always true for logical walsenders. > 0005 > 2. > --- a/src/backend/access/transam/xlogfuncs.c > +++ b/src/backend/access/transam/xlogfuncs.c > @@ -38,6 +38,7 @@ > #include "utils/pg_lsn.h" > #include "utils/timestamp.h" > #include "utils/tuplestore.h" > +#include "storage/standby.h" > > The header includes should be in alphabetical order. > Good catch, thanks! Done in V62. Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com