pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Achilleas Mantzios <achill@matrix.gatewaynet.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: PostgreSQL logical replication depends on WAL segments?
Date: Tue, 22 Jan 2019 18:17:18 +0200
Message-ID: <67714b88-9c9a-8b37-0009-e8643e586388@matrix.gatewaynet.com> (raw)
In-Reply-To: <CAGvVEFsOCCi7xHWtXsDQ4mb9VVYB3TrKgpq+6i8JHkNPBw_TXA@mail.gmail.com>
References: <CAGvVEFvq_VM9LhYPeu+Uw__gEVvrBffGL=FO-88cZEp-35+arA@mail.gmail.com>
	<507c69ad-e87b-2180-c2ec-08e1aee20352@aklaver.com>
	<CAGvVEFsOCCi7xHWtXsDQ4mb9VVYB3TrKgpq+6i8JHkNPBw_TXA@mail.gmail.com>

On 22/1/19 6:01 μ.μ., Josef Machytka wrote:
>
>     https://www.postgresql.org/docs/11/logical-replication-architecture.html
>
>
> Thanks, I see... So if I understand it correctly - since I have quite big partitions like ~30 GB each in one parent table and from ~1GB to ~5 GB in several others I presume I had to set 
> wal_keep_segments to some really high number and stop our security cronjob cleaning old WAL segments (because we already had some problems with almost full disk due to old WAL segments)

I asked you if you had any cron jobs messing around with your WALs. The WALs in pg_wal dir is PostgreSQL's business to manage, not your scripts. Dont do that. Defining wal_keep_segments to a very 
large value or using replication slots (as with logical repl) won't help if your crons are deleting the WALs.
Now what you have to do :
- read up about the basic concepts of pgsql administration : https://www.postgresql.org/docs/11/admin.html
- understand how postgresql replication slots work (logical repl is based on those)
- understand how WAL archiving works
- understand how streaming replication works
- understand how logical replication works
- understand how the various runtime configuration params act on the number of WALs kept

> until the whole transfer of snapshot is done. Because only after the whole snapshot is transferred logical replication workers start to transfer WAL logs reflecting changes done from the moment 
> snapshot was taken...
>
> jm


-- 
Achilleas Mantzios
IT DEV Lead
IT DEPT
Dynacom Tankers Mgmt

view thread (21+ messages)  latest in thread

Message-ID: <67714b88-9c9a-8b37-0009-e8643e586388@matrix.gatewaynet.com>
Permalink:  ../67714b88-9c9a-8b37-0009-e8643e586388@matrix.gatewaynet.com/
Also on:    postgresql.org/message-id/67714b88-9c9a-8b37-0009-e8643e586388@matrix.gatewaynet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: achill@matrix.gatewaynet.com
  Subject: Re: PostgreSQL logical replication depends on WAL segments?
  In-Reply-To: <67714b88-9c9a-8b37-0009-e8643e586388@matrix.gatewaynet.com>
  References: <CAGvVEFvq_VM9LhYPeu+Uw__gEVvrBffGL=FO-88cZEp-35+arA@mail.gmail.com> <507c69ad-e87b-2180-c2ec-08e1aee20352@aklaver.com> <CAGvVEFsOCCi7xHWtXsDQ4mb9VVYB3TrKgpq+6i8JHkNPBw_TXA@mail.gmail.com> <67714b88-9c9a-8b37-0009-e8643e586388@matrix.gatewaynet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox