Skip to content

Enable hot_standby when using ReplicationSlot WAL limit policy (v17–v18) - #66

Merged
souravbiswassanto merged 1 commit into
masterfrom
fix/hot-standby-replication-slot
Jul 28, 2026
Merged

Enable hot_standby when using ReplicationSlot WAL limit policy (v17–v18)#66
souravbiswassanto merged 1 commit into
masterfrom
fix/hot-standby-replication-slot

Conversation

@souravbiswassanto

Copy link
Copy Markdown
Member

Summary

  • Fixes standby startup failure when WAL_LIMIT_POLICY=ReplicationSlot due to existing logical replication slots requiring hot_standby = on
  • Updates both fresh initialization (run.sh) and warm standby recovery (warm_stanby.sh) for versions 17 and 18
  • Ensures consistency: hot_standby is now enabled when either WAL_LIMIT_POLICY == "ReplicationSlot" or STANDBY == "hot"

Root cause

PostgreSQL refuses to start a standby with hot_standby = off if logical replication slots exist. The error was:

logical replication slot "ace_pgoutbox_slot" exists on the standby, but "hot_standby" = "off"

Testing

  • Verify standby starts successfully when WAL_LIMIT_POLICY=ReplicationSlot is set
  • Verify hot standby mode still works when explicitly enabled via STANDBY=hot
  • Verify non-replication-slot configurations continue to work as before

When WAL_LIMIT_POLICY is set to ReplicationSlot, PostgreSQL requires
hot_standby to be enabled on standbys to prevent startup failures with
existing logical replication slots. This fixes the error:
"logical replication slot exists on the standby, but hot_standby = off"

Updated both fresh initialization (run.sh) and warm standby recovery
(warm_stanby.sh) scripts to respect WAL_LIMIT_POLICY in addition to
the STANDBY variable when configuring hot_standby.

Fixes #66

Signed-off-by: souravbiswassanto <sourav.cse4.bu@gmail.com>
@souravbiswassanto
souravbiswassanto force-pushed the fix/hot-standby-replication-slot branch from c3010a7 to 95555ba Compare July 28, 2026 10:26
@souravbiswassanto
souravbiswassanto merged commit d61a2a7 into master Jul 28, 2026
4 checks passed
@souravbiswassanto
souravbiswassanto deleted the fix/hot-standby-replication-slot branch July 28, 2026 10:48
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