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 1gm2K2-0005ms-8E for pgsql-general@arkaria.postgresql.org; Tue, 22 Jan 2019 20:06:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gm2K1-0006gb-1V for pgsql-general@arkaria.postgresql.org; Tue, 22 Jan 2019 20:06:57 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gm2K0-0006gU-Md for pgsql-general@lists.postgresql.org; Tue, 22 Jan 2019 20:06:56 +0000 Received: from hermes.gatewaynet.com ([193.92.121.98]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gm2Js-0007WX-Aq for pgsql-general@lists.postgresql.org; Tue, 22 Jan 2019 20:06:55 +0000 Received: from hercules.internal.net (hercules.internal.net [10.9.200.8]) by hermes.gatewaynet.com (8.14.3/8.14.3/Debian-9.4) with ESMTP id x0MK6iaP002902 for ; Tue, 22 Jan 2019 22:06:44 +0200 Received: from [10.9.251.5] (dcmchgw.internal.net [10.9.0.1]) by hercules.internal.net (Postfix) with ESMTPS id A05121350AE9 for ; Tue, 22 Jan 2019 22:06:43 +0200 (EET) Subject: Re: PostgreSQL logical replication depends on WAL segments? To: pgsql-general@lists.postgresql.org References: <507c69ad-e87b-2180-c2ec-08e1aee20352@aklaver.com> <20190122185244.7eakjblhzgvpcuyh@alap3.anarazel.de> From: Achilleas Mantzios Message-ID: <323036f2-079c-274d-9f10-5c4f8e89c689@matrix.gatewaynet.com> Date: Tue, 22 Jan 2019 22:06:41 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------B5F2CA8E720151D6F7A96485" Content-Language: en-US X-Virus-Scanned: clamav-milter 0.98.7 at hermes X-Virus-Status: Clean X-Spam-Status: No, score=2.0 required=5.0 tests=ALL_TRUSTED,DYN_SPAM_SUBJ, HTML_MESSAGE autolearn=no version=3.3.1 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on hermes.gatewaynet.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------B5F2CA8E720151D6F7A96485 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 22/1/19 8:59 μ.μ., Jeremy Finzel wrote: > On Tue, Jan 22, 2019 at 12:52 PM Andres Freund > wrote: > > Hi, > > On 2019-01-22 11:10:27 -0600, Jeremy Finzel wrote: > > P.S. do heed the advice of the others and get more familiar with > the docs > > around WAL archiving. > > Logical replication doesn't normally interact with WAL archiving > in any > way, so that seems orthogonal. > > > But he is manually removing WAL files via cron which should normally > be held until the replication slot doesn't need it anymore.  I do > believe that is why he is getting errors.  The suggestion is to rely > on Postgres' WAL archiving rather than removing WAL files manually... wal retention in pg_wal and wal archiving are different things. The OP got problems cause he deliberately went on to delete files in pg_wal which means he used the wrong method to address a wrong situation. However, if the OP has still those WAL files archived he can use them to bring logical replication back in synch. Don't ask me how I know : https://www.postgresql.org/message-id/ae8812c3-d138-73b7-537a-a273e15ef6e1%40matrix.gatewaynet.com > > Thanks, > Jeremy --------------B5F2CA8E720151D6F7A96485 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

On 22/1/19 8:59 μ.μ., Jeremy Finzel wrote:

On Tue, Jan 22, 2019 at 12:52 PM Andres Freund <andres@anarazel.de> wrote:
Hi,

On 2019-01-22 11:10:27 -0600, Jeremy Finzel wrote:
> P.S. do heed the advice of the others and get more familiar with the docs
> around WAL archiving.

Logical replication doesn't normally interact with WAL archiving in any
way, so that seems orthogonal.

But he is manually removing WAL files via cron which should normally be held until the replication slot doesn't need it anymore.  I do believe that is why he is getting errors.  The suggestion is to rely on Postgres' WAL archiving rather than removing WAL files manually...

wal retention in pg_wal and wal archiving are different things. The OP got problems cause he deliberately went on to delete files in pg_wal which means he used the wrong method to address a wrong situation.

However, if the OP has still those WAL files archived he can use them to bring logical replication back in synch. Don't ask me how I know : https://www.postgresql.org/message-id/ae8812c3-d138-73b7-537a-a273e15ef6e1%40matrix.gatewaynet.com


Thanks,
Jeremy 
--------------B5F2CA8E720151D6F7A96485--