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 1nRTch-000383-JY for pgsql-hackers@arkaria.postgresql.org; Tue, 08 Mar 2022 06:47: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 1nRTcg-0002Nv-Fd for pgsql-hackers@arkaria.postgresql.org; Tue, 08 Mar 2022 06:47: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 1nRTcg-0002Mp-4d for pgsql-hackers@lists.postgresql.org; Tue, 08 Mar 2022 06:47:06 +0000 Received: from mail-qt1-x82c.google.com ([2607:f8b0:4864:20::82c]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nRTcd-0002Fz-Vl for pgsql-hackers@lists.postgresql.org; Tue, 08 Mar 2022 06:47:05 +0000 Received: by mail-qt1-x82c.google.com with SMTP id 11so15351853qtt.9 for ; Mon, 07 Mar 2022 22:47:03 -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=eO0xixvDXVUEvCF3R6/v5S6pRKsoEP1V+h44uYHsH5o=; b=iFGTpiE3CFSLAohEVI+g+P95FfF7K9qkJ6UHij+VzEUbFn4dsRRxJ0OtoumvjX8Mck Ak9/66nbDhXq6UbuTVYgz+QBRNHPRO4YR4roFWhK3zX0gE/oonnjm8VK9x65iCk4gm4f aGHiWKBsMelsHLC88x3kqBhJQLENXXnWb9bYv40LDuAe9Z92t8QQydcPhiukaPVnSExn d8VeUkS5oyl07shbG5xBmk9z2QBgwdjYhCTGtfVTiZnjfpegZE/9B9Sz5Q5xy0tYSZIz f9J5u4TDDqOb/uDi/xoQyToofu7asIQuMXjByXeqPlEmoN/IIPLUbRxwjQkeGQcpSIL8 V8kA== 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=eO0xixvDXVUEvCF3R6/v5S6pRKsoEP1V+h44uYHsH5o=; b=zMaPNXTDDo0hhymY6ZUMW09LQWx2Ll1+00Vr3HRz0sWuR3sUgG1J2LiKl0f/mQvv+o SGahWJMSvDdQIlTOYDmr24bV2ICwxtg2UoIeNmx471I/2JnPgOnd0/i8RmGLURTZ6Qzw xle+1wzxhFepgC4zjdGo1m8fhfB8XpJ+T9+X7rqrunUu72gaouQ9298i7zFp+ceOZ5Tq xYhWbGix4qlpTKnzL7Lia8hVqEuCy9WEBpJSkx9ZUGTtVkkZE6R243UOaKDrnFm4PnE+ zxYgVr18Hlz1KG0uByM1quFuq+ZWiVQCtsPTpU36IU1xb9u06UAMROD7DyGPLTZtf6dd kRFQ== X-Gm-Message-State: AOAM530ayspv+IMRWkaPLdbcNrpxthiQJ6tMVFZKi1ZZ/HiQcrzkp86W WkiV2/cpbMs1LXFTX+5RW67J1HZqX5kmsrNP/gM= X-Google-Smtp-Source: ABdhPJyRSYa7B8rnICDTZL8PMHbQ3MZ4ufiVoOFRAnyILLwzZz77QMXo7jR6APwqhkDFDY+XFTNtNyyMPo45CHAayIc= X-Received: by 2002:ac8:5f87:0:b0:2df:f50f:f4c8 with SMTP id j7-20020ac85f87000000b002dff50ff4c8mr12095990qta.46.1646722021995; Mon, 07 Mar 2022 22:47:01 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Peter Smith Date: Tue, 8 Mar 2022 17:46:37 +1100 Message-ID: Subject: Re: Handle infinite recursion in logical replication setup To: Amit Kapila Cc: vignesh C , Ashutosh Bapat , "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 Tue, Mar 8, 2022 at 4:21 PM Amit Kapila wrote: > > On Tue, Mar 8, 2022 at 10:31 AM Peter Smith wrote: > > > > IIUC the new option may be implemented subscriber-side and/or > > publisher-side and/or both, and the subscriber-side option may be > > "enhanced" in future to prevent cycles. And probably there are more > > features I don't know about or that have not yet been thought of. > > > > ~~ > > > > Even if the plan is only to implement just one part now and then add > > more later, I think there still should be some consideration for what > > you expect all possible future options to look like, because that may > > affect current implementation choices. > > > > The point is: > > > > - we should take care so don't accidentally end up with an option that > > turned out to be inconsistent looking on the subscriber-side / > > publisher-side. > > > > - we should try to avoid accidentally painting ourselves into a corner > > (e.g. stuck with a boolean option that cannot be enhanced later on) > > > > Agreed. I think it is important to see we shouldn't do something which > is not extendable in future or paint us in the corner. But, as of now, > with the current proposal, the main thing we should consider is > whether exposing the boolean option is okay or shall we do something > different so that we can extend it later to specific origin ids? > I was wondering, assuming later there is an enhancement to detect and prevent cycles using origin ids, then what really is the purpose of the option? I can imagine if a cycle happens should probably log some one-time WARNING (just to bring it to the user's attention in case it was caused by some accidental misconfiguration) but apart from that why would this need to be an option at all - i.e. is there a use-case where a user would NOT want to prevent a recursive error? ------ Kind Regards, Peter Smith. Fujitsu Australia