Re: Different Autovacuum Settings on Master and Replica in Streaming Replication

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: Franjo Stipanovic <fritzfs(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Different Autovacuum Settings on Master and Replica in Streaming Replication
Date: 2025-01-17 15:34:31
Message-ID: CAECtzeWsUE5EV_w8yRre28hZBUXPWE-fkFrqf7__B29jWAjP3Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

Le ven. 17 janv. 2025 à 15:38, Franjo Stipanovic <fritzfs(at)gmail(dot)com> a
écrit :

> Question regarding autovacuum settings in a PostgreSQL streaming
> replication setup. Specifically, I am curious about whether it is possible
> (and advisable) to have different values for the following settings on the
> master and replica databases:
> - autovacuum_vacuum_scale_factor
> - autovacuum_analyze_scale_factor
>
> Can the above settings be configured differently on the master and replica
> databases in a streaming replication setup? I just tested this on AWS RDS
> Postgres.
>

They could but it doesn't matter. VACUUM and ANALYZE aren't executed on
replicas because they are write operations, and you can't write on replicas.

> How would those different settings interact with replication, for example,
> if I apply change on master, would it be replicated to replica and override
> my replica setting?
>
Changes on the postgresq.conf file aren't replicated, but ALTER TABLE ...
(SET autovacuum...) are.

> I was expecting that this is not possible in streaming replication, only
> in logical replication.
>

You're right, it's not possible.

--
Guillaume.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Franjo Stipanovic 2025-01-17 17:12:07 Re: Different Autovacuum Settings on Master and Replica in Streaming Replication
Previous Message Tom Lane 2025-01-17 15:34:23 Re: Different Autovacuum Settings on Master and Replica in Streaming Replication