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 1p5hAk-00036m-WE for pgsql-hackers@arkaria.postgresql.org; Thu, 15 Dec 2022 05:52:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p5hAj-0003pt-Lb for pgsql-hackers@arkaria.postgresql.org; Thu, 15 Dec 2022 05:52:45 +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 1p5hAj-0003pS-Ac for pgsql-hackers@lists.postgresql.org; Thu, 15 Dec 2022 05:52:45 +0000 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1p5hAc-0001X3-Ja for pgsql-hackers@postgresql.org; Thu, 15 Dec 2022 05:52:44 +0000 Received: by mail-pl1-x631.google.com with SMTP id x2so4442926plb.13 for ; Wed, 14 Dec 2022 21:52:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:from:subject:cc:to:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=fH+lRmdGvKIqKAjgSzqfkKpMKVXo8EXINA/xYxpdKjg=; b=VmqS9H/gCgARshgzTJs6DyIkcOPQ8P3HERX9k1jehT8lCC4p6445zWhIeEihIMyowD K0dXg9PikkkEaLDi5rgVp7T2zuO91wdh7pTE8RIiFdcnfps8LjsxpHjcIYN5VbeVv8iO anSi/JyylNjMAKRf3Ca9IA+6vIM1PkCd3m7kjbQ+92Hao4XH3bZowIRF95tVZ83KyFIh MWTABELSjyJZSt1AtK30PH6Dd26WYpNtF9KLSUBNB2TcvS/aHGHi6AOtLJxH4RJZ8k+N NwYym5i96aRszoLimpL0hIwPSq/5H7Hw+BbjT0pdR3hb4OhTVZFGicrHoCzsdR69eHkU 93xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:from:subject:cc:to:message-id:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=fH+lRmdGvKIqKAjgSzqfkKpMKVXo8EXINA/xYxpdKjg=; b=ax3Sb4H3FEVNMk/MMy4rFgAjf2QQCtplyWby6K+W0l37KLw/OJR5P/mXNMJ4ksPNFZ AlhUkVXClYu7cKjM8j5ZTjqUg1PkpmEKlrLxWls/aFMjOXxqBOEnu7exattqlYfI6W40 lNf1bazQ44Gsm8xLzTqHsYa4yIexYMlgkdtX4aci4mzPU2H9mNtHo2sPx9lgU/dwpTPL +zEzRgPMymovRI45nBAgCnTYcdEreJCi+RQZxpTpb+9xTxxled5RgPkFs+3JMMtCaNOw TMoQh/SqeLhRJg+ZlEUwwk5de3u3EO/PqwJ+dWZS88xCpZX9uHdxbyt2XWrQfejvKRnw Vlng== X-Gm-Message-State: AFqh2kqtrwgHS89ltxUReJfxOxY/GUMhWOsI7g/LX15zFruxhSHI6sOi 4OX+bRWEdWnKWWRHm7mB/pI= X-Google-Smtp-Source: AMrXdXvPBrdwJJJX/OVrT6ZH3yBZFnV1G2l96SYiHKr0GjMgZaS1STiPkm+CZ0ZeVAgWrS54E+G3KQ== X-Received: by 2002:a17:903:31d6:b0:190:ead0:7b1d with SMTP id v22-20020a17090331d600b00190ead07b1dmr4989192ple.42.1671083556533; Wed, 14 Dec 2022 21:52:36 -0800 (PST) Received: from localhost (KD036014041111.ppp-bb.dion.ne.jp. [36.14.41.111]) by smtp.gmail.com with ESMTPSA id x3-20020aa78f03000000b0056d3b8f530csm816867pfr.34.2022.12.14.21.52.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 14 Dec 2022 21:52:35 -0800 (PST) Date: Thu, 15 Dec 2022 14:52:32 +0900 (JST) Message-Id: <20221215.145232.3863147473914608.horikyota.ntt@gmail.com> To: amit.kapila16@gmail.com Cc: kuroda.hayato@fujitsu.com, osumi.takamichi@fujitsu.com, vignesh21@gmail.com, euler@eulerto.com, m.melihmutlu@gmail.com, andres@anarazel.de, marcos@f10.com.br, pgsql-hackers@postgresql.org, smithpb2250@gmail.com Subject: Re: Time delayed LR (WAS Re: logical replication restrictions) From: Kyotaro Horiguchi In-Reply-To: References: <20221215.134152.1754454051761023771.horikyota.ntt@gmail.com> User-Agent: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk At Thu, 15 Dec 2022 10:29:17 +0530, Amit Kapila wrote in > On Thu, Dec 15, 2022 at 10:11 AM Kyotaro Horiguchi > wrote: > > > > At Thu, 15 Dec 2022 09:18:55 +0530, Amit Kapila wrote in > > > On Thu, Dec 15, 2022 at 7:22 AM Kyotaro Horiguchi > > > wrote: > > > subscriber was busy enough that it doesn't need to add an additional > > > delay before applying a particular transaction(s) but adding a delay > > > to such a transaction on the publisher will actually make it take much > > > longer to reflect than expected. We probably need to name this > > > > Isn't the name min_apply_delay implying the same behavior? Even though > > the delay time will be a bit prolonged. > > > > Sorry, I don't understand what you intend to say in this point. In > above, I mean that the currently proposed patch won't have such a > problem but if we apply delay on publisher the problem can happen. Are you saing about the sender-side delay lets the whole transaction (if it have not streamed out) stay on the sender side? If so... yeah, I agree that it is undesirable. > > > parameter as min_send_delay if we want to do what you are saying and > > > then I don't know if it serves the actual need and also it will be > > > different from what we do in physical standby. > > > > In the first place phisical and logical replication works differently > > and the mechanism to delaying "apply" differs even in the current > > state in terms of logrep delay choking stream. > > > > I think the first preference is to make it work in a similar way (as > much as possible) to how this parameter works in physical standby and > if that is not at all possible then we may consider other approaches. I uderstood that. However, still I think choking the stream on the receiver-side alone is kind of ugly since it is breaking the protocol assumption, that is, the in-band maintenance packets are processed in a on-time manner on the peer under normal operation (even though involving some delays for some natural reasons). In this regard, I inclined to be in favor of Kuroda-san'sproposal.. regards. -- Kyotaro Horiguchi NTT Open Source Software Center