Skip to content

Populate /role_scripts/standby for remote replica coordinator#62

Open
souravbiswassanto wants to merge 1 commit into
masterfrom
remote-replica-rewind
Open

Populate /role_scripts/standby for remote replica coordinator#62
souravbiswassanto wants to merge 1 commit into
masterfrom
remote-replica-rewind

Conversation

@souravbiswassanto

Copy link
Copy Markdown
Member

Summary

  • In init_scripts/run.sh, the REMOTE_REPLICA=true branch now also copies standby scripts into /role_scripts/standby/ in addition to /run_scripts/role/

Problem

The pg-coordinator's AddRoleBasedScripts() restores postgres startup scripts after a crash by copying from /role_scripts/<raftRole>/ (e.g. /role_scripts/standby/). For HA clusters the init container populates this directory, but for remote replicas it only populated /run_scripts/role/ and left /role_scripts/ empty. This caused AddRoleBasedScripts() to silently fail, leaving postgres unable to restart after recovery.

Test plan

  • Deploy a remote replica with the new pg-coordinator (remote replica mode)
  • Trigger a recovery scenario (timeline divergence)
  • Verify the coordinator can successfully call AddRoleBasedScripts() and postgres restarts with the correct standby scripts

Signed-off-by: souravbiswassanto <saurov@appscode.com>
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