We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ca89fbd commit 5a04a88Copy full SHA for 5a04a88
ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh
@@ -467,7 +467,11 @@ EOF
467
# Extra work to ensure postgres is actually stopped
468
# Mostly needed for PG12 projects with odd systemd unit behavior
469
if [ -z "$IS_CI" ]; then
470
- retry 5 systemctl restart postgresql
+ REPLICATION_SLOT_COUNT=$(run_sql -A -t -c "SELECT COUNT(*) FROM pg_replication_slots;")
471
+ if [[ "$REPLICATION_SLOT_COUNT" -eq 0 ]]; then
472
+ echo "No replication slots found; restarting postgres"
473
+ retry 5 systemctl restart postgresql
474
+ fi
475
systemctl disable postgresql
476
retry 5 systemctl stop postgresql
477
0 commit comments