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 1nRb6m-0000IR-Ln for pgsql-hackers@arkaria.postgresql.org; Tue, 08 Mar 2022 14:46:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nRb6l-0008Ct-JJ for pgsql-hackers@arkaria.postgresql.org; Tue, 08 Mar 2022 14:46:39 +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 1nRb6l-0008Ck-9q for pgsql-hackers@lists.postgresql.org; Tue, 08 Mar 2022 14:46:39 +0000 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nRb6i-0007Fb-Q4 for pgsql-hackers@lists.postgresql.org; Tue, 08 Mar 2022 14:46:38 +0000 Received: by mail-ej1-x631.google.com with SMTP id dr20so39681239ejc.6 for ; Tue, 08 Mar 2022 06:46:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bn4zTg4OxArgHeaROdZsbEEFG9y0TA11BrmyU8xYcLI=; b=liKtNv+18cnlZBhH/dPjj2Glj4fnb9Cen1mFG58BKlGjX/HrYRjh6v0UjIkRBgzEUM nEDWbaM5W5BZqqVWGdCgnNgsdbXU6xwF1CktzYkkAKHXcy599N81kUWYMrXfPJ7aNxBL bRVy9ZgwDdiHW+kdwhNurQFh1vZ2E/bOxWYq42rgyO90T6QiiDGxdQ9CckIsl1M4q4LR pB4zcryrq0VII+ez02xYiawR2P6nK8tBfFFNY8jnOuIq9S18S+oUDQYMe0mMfeYkeC9O UMrlD3QCOW+07V051AcTZzwRGZvN63Et1Ush6iXzu3knoWYmoAGgVJOJ00Dk8VK+79Ft hhHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bn4zTg4OxArgHeaROdZsbEEFG9y0TA11BrmyU8xYcLI=; b=Uno88gnyF/MP+40ukRzi9NZN4O4AIa6qONNU7UodYlzjHASjFh1ilhsUGHFvGWdn86 vnAK4R/YPzijfRpNHbahMvN9rEdpVW8SaDF9jU8VYiAT23MO0k4hhJYXB7F2DekgKJPj plbPoQoSdtQfXBAfs+zdT8aDGrzicB6inmLGjF/mzj/7hSbFUDbCgclEgqrRkhv8wDo9 itdOzFcPZPgtyVIGJ482Aa94Yz2gl1vQnLhko49OSPf4F7+uxN3FgayFu/JBqeC5KcGX tm71hDQeWCiySR0UbZgBpGXkbTJ3s7f+l7KoabC3lwsXHeyzf8l9TM+xkH4Z9Slo2SUA XT4Q== X-Gm-Message-State: AOAM532E8OLCSTAIuqOcDyCa4Hu6cX8ng4rRJgcHkcEkMLwFoQayBDMM eGQ6A57A7Ei+TGVKFCVg9+rFhJzpF7PsdgMF/UI= X-Google-Smtp-Source: ABdhPJxORpQJz2qUCElnRox2MN7uxn83t6qE3gdbLw6a6O7wGhVsKHTn55gOr7WNgKx5sSsQN7N0QCR//IevpEfdARA= X-Received: by 2002:a17:907:298f:b0:6da:b3da:19e with SMTP id eu15-20020a170907298f00b006dab3da019emr13570398ejc.423.1646750795738; Tue, 08 Mar 2022 06:46:35 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: vignesh C Date: Tue, 8 Mar 2022 20:16:24 +0530 Message-ID: Subject: Re: Handle infinite recursion in logical replication setup To: Amit Kapila Cc: Ashutosh Bapat , Peter Smith , "kuroda.hayato@fujitsu.com" , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Mar 7, 2022 at 9:57 PM vignesh C wrote: > > On Mon, Mar 7, 2022 at 5:51 PM Amit Kapila wrote: > > > > On Mon, Mar 7, 2022 at 5:01 PM Ashutosh Bapat > > wrote: > > > > > > Hi Vignesh, > > > I agree with Peter's comment that the changes to > > > FilterRemoteOriginData() should be part of FilterByOrigin() > > > > > > Further, I wonder why "onlylocal_data" is a replication slot's > > > property. A replication slot tracks the progress of replication and it > > > may be used by different receivers with different options. I could > > > start one receiver which wants only local data, say using > > > "pg_logical_slot_get_changes" and later start another receiver which > > > fetches all the data starting from where the first receiver left. This > > > option prevents such flexibility. > > > > > > As discussed earlier in the thread, local_only can be property of > > > publication or subscription, depending upon the use case, but I can't > > > see any reason that it should be tied to a replication slot. > > > > > > > I thought it should be similar to 'streaming' option of subscription > > but may be Vignesh has some other reason which makes it different. > > Yes, this can be removed from the replication slot. It is my mistake > that I have made while making the code similar to two-phase, I'm > working on making the changes for this. I will fix and post an updated > version for this. I have made the changes for this, the changes for this are available in the v3 patch attached at [1]. [1] - https://www.postgresql.org/message-id/CALDaNm0JcV-7iQZhyy3kehnWTy6x%3Dz%2BsX6u6Df%2B%2By8z33pz%2BBw%40mail.gmail.com Regards, Vignesh