Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tYoMx-00FUDQ-Cf for pgsql-general@arkaria.postgresql.org; Fri, 17 Jan 2025 15:34:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tYoMw-000ZjT-0k for pgsql-general@arkaria.postgresql.org; Fri, 17 Jan 2025 15:34:46 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tYoMv-000Zed-IO for pgsql-general@lists.postgresql.org; Fri, 17 Jan 2025 15:34:46 +0000 Received: from mail-qv1-xf2a.google.com ([2607:f8b0:4864:20::f2a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tYoMs-0002ee-3A for pgsql-general@lists.postgresql.org; Fri, 17 Jan 2025 15:34:45 +0000 Received: by mail-qv1-xf2a.google.com with SMTP id 6a1803df08f44-6dd16e1cfa1so19075006d6.1 for ; Fri, 17 Jan 2025 07:34:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lelarge-info.20230601.gappssmtp.com; s=20230601; t=1737128082; x=1737732882; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=t6PUgz8sowk4XN8/RkJz4DIrJNJ8Rh8pSceQEGkOvTI=; b=QmMHuKk4XTthIiyEdmpoDUALZxx2I4nWM6fR3Vw+OBEREgFfz/Pk6s9xQDn+QgoDKl B0Wr3X++DDbOI0tRKEv6yXT5A9zDKijJ48AEo5xSatg6/X619SCRE8i5Joys4MHbTdT4 AAQeBz86ACrVqEKZ52yIo6yDQm+h2piq6fdPddE7I7OMDxa8TJ2fP5jZ6cJxdMmGalwn W/rZLgcgsNatcsb/xskcAW8wzGD4uJx6eRNXsfgMmQWKHj0KCKKywX43flP8RtGXKCX1 OkNkWekmQ+cO3OwYEEusJdAwpk4R2Lux4US184HIbcgRXp33NcVjs6TO3bLW6EQaYc69 ubLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737128082; x=1737732882; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=t6PUgz8sowk4XN8/RkJz4DIrJNJ8Rh8pSceQEGkOvTI=; b=Ev13vEmHcrmGyo+aBKc43csSXSUaS0c9jeYWqV9ykKKyqqsM/28kXZJEWPIGnBbbSy z6r3q1GQgcnepAB2C+BM4n76z3fzmiB+RjYuLZ5cr2yEsMv306f6S3c6igKzWK3NIQHK TLRcksmwqWBPvTc/lW94jD+IT9pqXDWphfzOsGH6nG5i1yWwhAsBlQ9VkGRGS1wm4n4w vwLPhcCyKOOdGTRH6bl6hf7j4IwI3WxNn9dK6Jw2oqoUq0qTXoTitzIT4O7XBhD7trxy Y12axfXCp69efLrQtq2EWah1M8d1N3AAPg94H3Jkft7l7YMzD6eWlDp5llSKSr5C3svo PkLQ== X-Gm-Message-State: AOJu0YyLJ5JJxIlZkGwoDEzu8kO2+gJ/5IcvLnOPQQulE1qgRS/M3PLr /04ET12tHEQTKpMnJG/BPhj6rDHKshQBT3Iwm6LDTQgMVEAhVniGCkFY2w1r37erlgfqDXF6Qvl Z7Ozxl6Lh+uB42m0HjuuhtxXajTZ2GAj0XoyG2Q== X-Gm-Gg: ASbGncvP93JSnpGjfcDIs0p/MRUMDGjNdeJWNt+Whwwm5EdwTp5X1KvoJP6bip/hTHx Igs3y1JMdu8wwk3IdHPZCy2vpa5iZTUgDB+vMslMJ6nPTTBjT0RvvOrxJVLG36RA27z/kyjLj X-Google-Smtp-Source: AGHT+IFn3ivEjtGaRuc1kReJp1iDbfc2eZSWhdRFJrjcDicGKzoe9hrPer91ryq4bzBk7niOsKgJ3n44TVEXkNI6Vyk= X-Received: by 2002:ad4:596c:0:b0:6d8:aa52:74a3 with SMTP id 6a1803df08f44-6e1b2213f57mr54000036d6.28.1737128082567; Fri, 17 Jan 2025 07:34:42 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Guillaume Lelarge Date: Fri, 17 Jan 2025 16:34:31 +0100 X-Gm-Features: AbW1kvY8HCO3PAb_r3KQNU3EbaClt3IUHLjf2wTa-0FKC8ELspVvv7wAP7V68W0 Message-ID: Subject: Re: Different Autovacuum Settings on Master and Replica in Streaming Replication To: Franjo Stipanovic Cc: pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="0000000000004a8881062be8a64e" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000004a8881062be8a64e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, Le ven. 17 janv. 2025 =C3=A0 15:38, Franjo Stipanovic a =C3=A9crit : > Question regarding autovacuum settings in a PostgreSQL streaming > replication setup. Specifically, I am curious about whether it is possibl= e > (and advisable) to have different values for the following settings on th= e > master and replica databases: > - autovacuum_vacuum_scale_factor > - autovacuum_analyze_scale_factor > > Can the above settings be configured differently on the master and replic= a > 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 overri= de > 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. --=20 Guillaume. --0000000000004a8881062be8a64e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

Le=C2=A0ven.= 17 janv. 2025 =C3=A0=C2=A015:38, Franjo Stipanovic <fritzfs@gmail.com> a =C3=A9crit=C2=A0:

Questio= n regarding autovacuum settings in a PostgreSQL streaming replication setup= . Specifically, I am curious about whether it is possible (and advisable) t= o have different values for the following settings on the master and replic= a databases:
-=C2=A0autovacuum_vacuum_scale_factor
- autovacuum_analy= ze_scale_factor

Can the above settings be configured differently on t= he master and replica databases in a streaming replication setup? I just te= sted this on AWS RDS Postgres.=C2=A0


<= div>They could but it doesn't matter. VACUUM and ANALYZE aren't exe= cuted on replicas because they are write operations, and you can't writ= e on replicas.
=C2=A0

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?=C2=A0

Changes on the postgresq.conf file aren't replicated= , but ALTER TABLE ... (SET autovacuum...) are.

I was expecting that t= his is not possible in streaming replication, only in logical replication.<= /p>


You're right, it's not po= ssible.


--
Guillaume.
--0000000000004a8881062be8a64e--