Re: Optimization of vacuum for logical replication

From: Sergei Kornilov <sk(at)zsrv(dot)org>
To: Konstantin Knizhnik <k(dot)knizhnik(at)postgrespro(dot)ru>, Bernd Helmle <mailings(at)oopsware(dot)de>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Optimization of vacuum for logical replication
Date: 2019-08-21 11:07:51
Message-ID: 1347121566385671@iva1-9be92bdead40.qloud-c.yandex.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello

> Also I can't believe that  DBA which explicitly sets wal_level is set to
> logical will use streaming replication without associated replication slot.

I am.

> Yes, it is possible to have physical replica withotu replication slot.
> But it is not safe, because there is always a risk that lag between
> master and replica becomes larger than size of WAL kept at master.

Just an example: replica for manual queries, QA purposes or for something else that is not an important part of the system.
If I use replication slots - my risk is out-of-space on primary and therefore shutdown of primary. With downtime for application.
If I use wal_keep_segments instead - I have some limited (and usually stable) amount of WAL but risk to have outdated replica.

I prefer to have an outdated replica but primary is more safe. Its OK for me to just take fresh pg_basebackup from another replica.
And application want to use logical replication so wal_level = logical.

If we not want support such usecase - we need explicitly forbid replication without replication slots.

regards, Sergei

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bernd Helmle 2019-08-21 11:45:27 Re: Optimization of vacuum for logical replication
Previous Message Amit Kapila 2019-08-21 10:37:50 Re: POC: Cleaning up orphaned files using undo logs