Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gQHeN-00051Z-G4 for pgsql-hackers@arkaria.postgresql.org; Fri, 23 Nov 2018 20:02:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gQHdL-0000zn-R8 for pgsql-hackers@arkaria.postgresql.org; Fri, 23 Nov 2018 20:00:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gQHdL-0000zg-Jx for pgsql-hackers@lists.postgresql.org; Fri, 23 Nov 2018 20:00:59 +0000 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gQHdD-00079j-Rw for pgsql-hackers@postgresql.org; Fri, 23 Nov 2018 20:00:58 +0000 Received: by mail-wm1-x343.google.com with SMTP id y139so12784590wmc.5 for ; Fri, 23 Nov 2018 12:00:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=cR+RZc0NOOUK5rhv3jFzWuE9c4m4PDts8KWIipz/DXk=; b=PEJFVkQe8706d+mkX/69BU40DSjhleROslZBzST+D1TMiU8KhsDPjA4bKl30rSEMdl MOOa7CJS6Hl39Mxb8KGmk2vrVRDVHfvnBzMdYXaoldCLehH62ousAqApcIG5Yb/FGwOv T3Xe9QL6dpajK03oRei15Lx1T4hAmLZoyJ/Obu03CFwNREIi7MfmqICEGw3ePrK2NUWZ mLsc/k3je5rZA3QV5KEt6lJ4PEcWC9P6vGx3ASdrFpDI/i2pji/EPPbic7jUn2+2fQIp w49hmLPwMPIfSezznyfCMmHTOanWQy7DwJPnOHYP8Fg933704WNHhlRcF8rh1v6Tc/o5 uPdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=cR+RZc0NOOUK5rhv3jFzWuE9c4m4PDts8KWIipz/DXk=; b=hsfEocCTe6JAmxjLg+50TSNsRd6CeZ8uB/Rn4vqQJkUMcnD4tWrGrXCTYJvYGTpnmK ii5rDjCYjHPhFKeQypKCwYifQg7CF1Ox32Ps9LfjeeLTYnCu9K3159y5XjWJOzNoj7Ee BuL8wBgea5d6M8i+FRhkQQyaMAdAiVlsSSs75MRsW1NZVEmNk+QUQ2rKKwcxiGX1pwxa v2rDMnPTxfNFJ4teZmzrK6FhuYUfDRtrBY+5DwYjpk4AzsN48fm1jaz0RkwRnEWIiTHc 8/T/Vd8LGKUp6lKxgThA6L9ye24R/Y59D5ICown8GJ7GdcGWzcq096l/ZQe0Tr4moW0u EYoQ== X-Gm-Message-State: AGRZ1gJL7VIzOnm5UKHrYEF/Va39EJdAWeYTpRI8rLvopXUCTPlIG9oG onzkLPSNu7AFrJY1SBd1+4G2Tg== X-Google-Smtp-Source: AJdET5fOdcEHDycvwBbwb0tc4w/dWofVZrSjYW20BV/UwFj3YAFhpuZ6Heo15J1TQ287zel0rnmYpA== X-Received: by 2002:a1c:85c5:: with SMTP id h188-v6mr14820001wmd.59.1543003249457; Fri, 23 Nov 2018 12:00:49 -0800 (PST) Received: from [10.137.2.19] (ip-86-49-251-50.net.upcbroadband.cz. [86.49.251.50]) by smtp.gmail.com with ESMTPSA id d4sm54557860wrp.89.2018.11.23.12.00.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Nov 2018 12:00:48 -0800 (PST) Subject: Re: row filtering for logical replication To: Stephen Frost , =?UTF-8?Q?Fabr=c3=adzio_de_Royes_Mello?= Cc: petr.jelinek@2ndquadrant.com, Euler Taveira de Oliveira , Pgsql Hackers , hironobu@interdb.jp References: <7106a0fc-8017-c0fe-a407-9466c9407ff8@2ndquadrant.com> <92e5587d-28b8-5849-2374-5ca3863256f1@2ndquadrant.com> <466cdec7-92a0-41c0-b74a-ec0be94d4451@2ndquadrant.com> <20181123190330.GI3415@tamriel.snowman.net> From: Tomas Vondra Message-ID: Date: Fri, 23 Nov 2018 21:00:46 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <20181123190330.GI3415@tamriel.snowman.net> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 11/23/18 8:03 PM, Stephen Frost wrote: > Greetings, > > * Fabrízio de Royes Mello (fabriziomello@gmail.com) wrote: >> On Fri, Nov 23, 2018 at 4:13 PM Petr Jelinek >> wrote: >>>> If carefully documented I see no problem with it... we already have an >>>> analogous problem with functional indexes. >>> >>> The difference is that with functional indexes you can recreate the >>> missing object and everything is okay again. With logical replication >>> recreating the object will not help. >>> >> >> In this case with logical replication you should rsync the object. That is >> the price of misunderstanding / bad use of the new feature. >> >> As usual, there are no free beer ;-) > > There's also certainly no shortage of other ways to break logical > replication, including ways that would also be hard to recover from > today other than doing a full resync. > Sure, but that seems more like an argument against creating additional ones (and for preventing those that already exist). I'm not sure this particular feature is where we should draw the line, though. > What that seems to indicate, to me at least, is that it'd be awful > nice to have a way to resync the data which doesn't necessairly > involve transferring all of it over again. > > Of course, it'd be nice if we could track those dependencies too, > but that's yet another thing. Yep, that seems like a good idea in general. Both here and for functional indexes (although I suppose sure is a technical reason why it wasn't implemented right away for them). > > In short, I'm not sure that I agree with the idea that we shouldn't > allow this and instead I'd rather we realize it and put the logical > replication into some kind of an error state that requires a resync. > That would still mean a need to resync the data to recover, so I'm not sure it's really an improvement. And I suppose it'd require tracking the dependencies, because how else would you mark the subscription as requiring a resync? At which point we could decline the DROP without a CASCADE, just like we do elsewhere, no? regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services