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 1o91E3-0007dv-FM for pgsql-admin@arkaria.postgresql.org; Wed, 06 Jul 2022 09:21:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o91E2-0006py-Bj for pgsql-admin@arkaria.postgresql.org; Wed, 06 Jul 2022 09:21:38 +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 1o91E2-0006pg-0U for pgsql-admin@lists.postgresql.org; Wed, 06 Jul 2022 09:21:38 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o91Dz-000518-Ar for pgsql-admin@lists.postgresql.org; Wed, 06 Jul 2022 09:21:37 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 72A515C0193; Wed, 6 Jul 2022 05:21:33 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Wed, 06 Jul 2022 05:21:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1657099293; x=1657185693; bh=R hEO5c/EPM39t7zw5G59JEvsihdTgb4Ql/uttkONbrE=; b=ct0KC9+Vp1a8cofWj Rz42pSMzOS62rXY/mkJDVpBTVJDq1+ErNsEzaa7WxooYXfakaqM+TMP3RPRImkQS ev5BaYBjA+wuGjq0h9ahzy6EkrpOva4NC1pFH2BBDIC/OnqdvM1n1Tt4Jv17etwJ Am5B46n499l56Mi32pkftNOgQnBBIYjKXCcqLomIGyXZeQ80ke//WnHo8BW3Kc2i +eQOQnczxos8L3qFlDroBBtxf2/My8u2icsIBbbnsW1+c7to7QUFPXTE5IjbXmqa Y2yKGWbBBmXfOu3KaLl/F+zVL1MTrRYniAabuE/LCm5+YJkvSHSTIUb+uMhHlEWQ PabGA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudeifedguddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvfhfhjggtgfesthekredttdefjeenucfhrhhomheprfgvthgv rhcugfhishgvnhhtrhgruhhtuceophgvthgvrhdrvghishgvnhhtrhgruhhtsegvnhhtvg hrphhrihhsvggusgdrtghomheqnecuggftrfgrthhtvghrnheplefgteefiedtleelgeeg jeevhfeuteefvddtjeehveeuieefgedvhfeuleduteeunecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomhepphgvthgvrhdrvghishgvnhhtrhgruhht segvnhhtvghrphhrihhsvggusgdrtghomh X-ME-Proxy: Feedback-ID: i131946ab:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 6 Jul 2022 05:21:32 -0400 (EDT) Message-ID: <4b3b8dae-fcd6-eb0f-c29f-f27a98a8d5b1@enterprisedb.com> Date: Wed, 6 Jul 2022 11:21:31 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: Logical replication and pg_dump for out of band synchronization Content-Language: en-US To: Joseph Hammerman , pgsql-admin@lists.postgresql.org References: From: Peter Eisentraut In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 04.07.22 22:40, Joseph Hammerman wrote: > We have been trying to use Logical Replication to synchronize some > oversized tables (1Tb+). > We are replicating from 9.6 -> 11.x. The long sync times for the initial > snapshots of these large tables  have been causing incidents however, > since autovacuum cannot clean up anything older than the xmin horizon. What replication system are you using with PG 9.6? If you are using pglogical, then it contains a program pglogical_create_subscriber that addresses this. > We then intend to take a dump, restore the table, and play back > the changes by enabling the Subscription. This way the bulk data > transfer is out of band from the production application. Our testing > shows that this works cleanly, and that new changes replicate correctly > to the target relations. Additionally, pg_dump has a —snapshot flag > which it appears was added to support this sort of workflow. Yes, this would also be a valid solution.