Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fjB6P-000632-HF for pgsql-general@arkaria.postgresql.org; Fri, 27 Jul 2018 22:20:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fjB6M-0002d7-SH for pgsql-general@arkaria.postgresql.org; Fri, 27 Jul 2018 22:20:46 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fjB6K-0002d0-Qt for pgsql-general@lists.postgresql.org; Fri, 27 Jul 2018 22:20:46 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fjB6G-0001au-N6 for pgsql-general@lists.postgresql.org; Fri, 27 Jul 2018 22:20:43 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id A637B21DB7; Fri, 27 Jul 2018 18:20:39 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Fri, 27 Jul 2018 18:20:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=AQRaSraay9XXm3JyAVjKhoXVNrHdd V7wvOaE9g4FJ1I=; b=ixwJYhV8y+7Js6ILCriOy1MZi1nMRl0E3IJQe8G4YxWne kgBR0YuXblt2iKgDT1GB3nQ1AB6R3KuDIpUusiQVkGPkDeNYc9EYTMXSrLNX6ZaE ndndoJYWvSlP0RNbilqeAcud+eLjD8Pjzjkg1xh0zv8fYuJwjyCQoHxwec4DofDf Mes8okHCDsOQ4gbiUI8vt3VCTAiXLqZBbPSaDoCnYz1CuEOQDVbfslg4QW4WaXxt +ALU8XvMQsJdIxllCEjHAsaw+T9p8ZC0mi9Liq92Anb3dmAKKqbodVF7FPArtnmp yQmo/d2mIYgr9ljQZhnRzBq/YDvRaJ2jU02Erx2YA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=AQRaSr aay9XXm3JyAVjKhoXVNrHddV7wvOaE9g4FJ1I=; b=uE6GNGt5IXfMhDAWcQlfv/ YbwqmhVMKuxZx7FBt0nyiAoSPG198A5Fd7p3NKuUNKK1Y8hkJydkb45uKQBAZfpa bPdzfy+2r8e8kN/2eS0LMq88qD7VW+yiTCc591X0FGxnwsPRPCyQTd7DaGDDp1x3 CUjYGoKqf5aRTUuQB0JkH8IrGBKklZD0289wxT6VZK1clr7pTVw7Bn/7Ku/pTlpG iSAuTHn7uqmQl6IISrGoveMflklNpeCW7e8gaiYk3sj/TOfInm/KhOEk7tdKMZ+h KFedDY/c+fEMBLUL6oJ1uyl2KCr8m1JKwd+KCxR+P1paw/2eVFHGZUQNMp+UAkIg == X-ME-Proxy: X-ME-Sender: Received: from [192.168.1.3] (unknown [71.212.134.181]) by mail.messagingengine.com (Postfix) with ESMTPA id 549DE10261; Fri, 27 Jul 2018 18:20:38 -0400 (EDT) Subject: Re: logical replication snapshots To: Dimitri Maziuk , pgsql-general@lists.postgresql.org References: <20180724172115.ztthbxmfgucnuuq3@alvherre.pgsql> <20180724184337.k6nq7k3cq7xoorjn@alap3.anarazel.de> <04dcfd2d-6201-09e7-4209-9894d669f694@bmrb.wisc.edu> <20180725152827.g22qmue3wgycifjh@alap3.anarazel.de> <9b9a72f4-44c8-5e78-8814-fdc39ca3a3ad@bmrb.wisc.edu> <1c539619-7b72-3669-81cd-2a55352b1008@aklaver.com> <20180726005706.gzinfqg7mjfnsf6g@alap3.anarazel.de> <10933bb0-5a3b-4ed2-fc6c-2a712510ef9b@aklaver.com> <00acc822-e5d6-b9ad-43a9-e989d8581ae7@bmrb.wisc.edu> <40f0b879-2b5b-05ad-57ba-3688510be87d@aklaver.com> <93e99c67-cdc5-e776-2a00-3ba090e2c4c4@aklaver.com> <1542cf6a-151d-24b6-afc2-b4cee0ae1aa1@bmrb.wisc.edu> <5c10ced3-7e1a-d673-1da9-d45985bf37f5@bmrb.wisc.edu> From: Adrian Klaver Message-ID: Date: Fri, 27 Jul 2018 15:20:37 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <5c10ced3-7e1a-d673-1da9-d45985bf37f5@bmrb.wisc.edu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 07/27/2018 03:04 PM, Dimitri Maziuk wrote: > On 07/26/2018 07:11 PM, Adrian Klaver wrote: >> On 07/26/2018 04:48 PM, Dimitri Maziuk wrote: > ... >>> The publication foopub is at this point fubar I take it? And needs to be >>> re-created on the publisher and reconnected on the subscriber? Complete >>> with with inital resync? >> >> Not sure. Personally I would try: >> >> 1) ALTER PUBLICATION DROP TABLE foo|bar; >> >> 2) ALTER PUBLICATION ADD TABLE foo|bar; >> >> 3) ALTER SUBSCRIPTION sub_name REFRESH PUBLICATION >> >> If you get to 3) it will re-sync the data unless you tell it otherwise. >> >> The above is probably dependent on the size of the publication. If you >> did a publication for ALL it would make more sense to do the above then >> if you did a publication for just foo or bar. > > ... but if I did the publication for ALL, I could just use streaming > replication and then drop table/add table would replicate automagically ... Well I was just showing the extremes from a single table publication to ALL tables. You can also do subsets of ALL. Remember that binary replication(streaming) involves the whole Postgres cluster, e.g. all the databases in the cluster no choice in the matter. Also it does not allow you to shape what is replicated. In other words what form of DML you want replicated e.g. UPDATE, INSERT, DELETE. Last but not least logical replication works across major versions and different OS'es, which binary replication does not. > > It looks like we probably have to re-think a few of our workflows and > procedures, and until/unless that happens, logical replication won't do > what we want. Which means figuring out this 13-million-files problem > becomes a very low priority for me. Unfortunately: it'd be nice to track > it down and squash it... > > Thanks everyone, > -- Adrian Klaver adrian.klaver@aklaver.com