From a1cc808a97c5a7c8a32cb38f6002900376e8b729 Mon Sep 17 00:00:00 2001 From: souravbiswassanto Date: Wed, 28 Oct 2026 17:23:56 +0600 Subject: [PATCH] Turn on summarize_wal when SUMMARIZE_WAL=on (PG17+) Incremental pg_basebackup needs WAL summaries reaching back to the parent backup. Standbys write them too, so a promoted standby can carry on the incremental chain. Signed-off-by: souravbiswassanto --- role_scripts/17/primary/start.sh | 5 +++++ role_scripts/17/standby/run.sh | 5 +++++ role_scripts/18/primary/start.sh | 5 +++++ role_scripts/18/standby/run.sh | 5 +++++ 4 files changed, 20 insertions(+) diff --git a/role_scripts/17/primary/start.sh b/role_scripts/17/primary/start.sh index 783406a..153e667 100755 --- a/role_scripts/17/primary/start.sh +++ b/role_scripts/17/primary/start.sh @@ -43,6 +43,11 @@ if [[ "${WAL_BACKUP_TYPE:-0}" == "WALG" ]]; then else echo "archive_command = '/bin/true'" >>/tmp/postgresql.conf fi +# WAL summaries let pg_basebackup --incremental send only the blocks changed since the parent +# backup. Standbys summarize the WAL they replay too, so a promoted standby can keep the chain. +if [[ "${SUMMARIZE_WAL:-off}" == "on" ]]; then + echo "summarize_wal = on" >>/tmp/postgresql.conf +fi PRELOAD="pg_stat_statements" if [[ "${TDE_ENABLED:-false}" == "true" ]]; then diff --git a/role_scripts/17/standby/run.sh b/role_scripts/17/standby/run.sh index 8e518e4..77cc372 100755 --- a/role_scripts/17/standby/run.sh +++ b/role_scripts/17/standby/run.sh @@ -160,6 +160,11 @@ if [[ "${WAL_BACKUP_TYPE:-0}" == "WALG" ]]; then else echo "archive_command = '/bin/true'" >>/tmp/postgresql.conf fi +# WAL summaries let pg_basebackup --incremental send only the blocks changed since the parent +# backup. Standbys summarize the WAL they replay too, so a promoted standby can keep the chain. +if [[ "${SUMMARIZE_WAL:-off}" == "on" ]]; then + echo "summarize_wal = on" >>/tmp/postgresql.conf +fi PRELOAD="pg_stat_statements" if [[ "${TDE_ENABLED:-false}" == "true" ]]; then diff --git a/role_scripts/18/primary/start.sh b/role_scripts/18/primary/start.sh index ab734d6..ae9ceeb 100755 --- a/role_scripts/18/primary/start.sh +++ b/role_scripts/18/primary/start.sh @@ -43,6 +43,11 @@ if [[ "${WAL_BACKUP_TYPE:-0}" == "WALG" ]]; then else echo "archive_command = '/bin/true'" >>/tmp/postgresql.conf fi +# WAL summaries let pg_basebackup --incremental send only the blocks changed since the parent +# backup. Standbys summarize the WAL they replay too, so a promoted standby can keep the chain. +if [[ "${SUMMARIZE_WAL:-off}" == "on" ]]; then + echo "summarize_wal = on" >>/tmp/postgresql.conf +fi PRELOAD="pg_stat_statements" if [[ "${TDE_ENABLED:-false}" == "true" ]]; then diff --git a/role_scripts/18/standby/run.sh b/role_scripts/18/standby/run.sh index 8e518e4..77cc372 100755 --- a/role_scripts/18/standby/run.sh +++ b/role_scripts/18/standby/run.sh @@ -160,6 +160,11 @@ if [[ "${WAL_BACKUP_TYPE:-0}" == "WALG" ]]; then else echo "archive_command = '/bin/true'" >>/tmp/postgresql.conf fi +# WAL summaries let pg_basebackup --incremental send only the blocks changed since the parent +# backup. Standbys summarize the WAL they replay too, so a promoted standby can keep the chain. +if [[ "${SUMMARIZE_WAL:-off}" == "on" ]]; then + echo "summarize_wal = on" >>/tmp/postgresql.conf +fi PRELOAD="pg_stat_statements" if [[ "${TDE_ENABLED:-false}" == "true" ]]; then