Re: PostgreSQL logical replication depends on WAL segments? - Mailing list pgsql-general

From Achilleas Mantzios
Subject Re: PostgreSQL logical replication depends on WAL segments?
Date
Msg-id 67714b88-9c9a-8b37-0009-e8643e586388@matrix.gatewaynet.com
Whole thread Raw
In response to Re: PostgreSQL logical replication depends on WAL segments?  (Josef Machytka <josef.machytka@gmail.com>)
List pgsql-general
On 22/1/19 6:01 μ.μ., Josef Machytka wrote:


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

pgsql-general by date:

Previous
From: Josef Machytka
Date:
Subject: Re: PostgreSQL logical replication depends on WAL segments?
Next
From: Denisa Cirstescu
Date:
Subject: Decrease time needed to CREATE INDEX and FOREIGN KEY on new tablecolumn which has all values NULL