Skip to content

fix(pg_upgrade): do not restart PG if replication slots are present #1725

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,11 @@ EOF
# Extra work to ensure postgres is actually stopped
# Mostly needed for PG12 projects with odd systemd unit behavior
if [ -z "$IS_CI" ]; then
retry 5 systemctl restart postgresql
REPLICATION_SLOT_COUNT=$(run_sql -A -t -c "SELECT COUNT(*) FROM pg_replication_slots;")
if [[ "$REPLICATION_SLOT_COUNT" -eq 0 ]]; then
echo "No replication slots found; restarting postgres"
retry 5 systemctl restart postgresql
fi
systemctl disable postgresql
retry 5 systemctl stop postgresql

Expand Down