Skip to content

Include pgtune.conf in remote replica postgresql.conf - #69

Merged
souravbiswassanto merged 1 commit into
masterfrom
remote-replica-pgtune-include
Aug 26, 2026
Merged

Include pgtune.conf in remote replica postgresql.conf#69
souravbiswassanto merged 1 commit into
masterfrom
remote-replica-pgtune-include

Conversation

@souravbiswassanto

Copy link
Copy Markdown
Member

Problem

The tuning include:

if [[ "${TUNING_ENABLED:-}" == "true" ]]; then
  echo "include_if_exists = '${TUNING_FILE_PATH:-/etc/config/pgtune.conf}'" >>/tmp/postgresql.conf
fi

is emitted by primary/start.sh and standby/run.sh, but not by standby/remote-replica.sh. Remote replica pods (REMOTE_REPLICA=true, dispatched through /run_scripts/role/remote-replica.sh) build their own /tmp/postgresql.conf from scratch, so the tuned configuration was silently ignored for that mode.

Change

Add the same block immediately after touch /tmp/postgresql.conf in role_scripts/{13,14,15,16,17,18}/standby/remote-replica.sh.

Placement matches the primary/standby scripts: the include comes first so the explicit settings written afterwards (replication, TDE, SSL, primary_conninfo, …) still take precedence over anything in pgtune.conf.

Versions 9–12 have no remote-replica.sh, so they are unaffected.

The tuning include (include_if_exists for pgtune.conf, gated on
TUNING_ENABLED) was already emitted by primary/start.sh and
standby/run.sh, but remote-replica.sh builds its own
/tmp/postgresql.conf and never included it. As a result remote
replica pods ignored the tuned configuration entirely.

Add the same block right after the config file is created in
role_scripts/{13..18}/standby/remote-replica.sh, matching the
placement used by the primary and standby scripts so explicit
settings written later still take precedence.

Signed-off-by: souravbiswassanto <sourav.cse4.bu@gmail.com>
@souravbiswassanto
souravbiswassanto merged commit d448678 into master Aug 26, 2026
5 checks passed
@souravbiswassanto
souravbiswassanto deleted the remote-replica-pgtune-include branch August 26, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant