launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #32882
[Merge] ~lgp171188/launchpad-bastion-scripts:staging-restore-use-the-primary-fqdn-for-all-operations into launchpad-bastion-scripts:main
Guruprasad has proposed merging ~lgp171188/launchpad-bastion-scripts:staging-restore-use-the-primary-fqdn-for-all-operations into launchpad-bastion-scripts:main.
Commit message:
Use the database primary's fqdn in all the staging DB restore commands
This uses the pgbouncer fqdn, assuming that the active pgbouncer is always on the primary.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~lgp171188/launchpad-bastion-scripts/+git/launchpad-bastion-scripts/+merge/491117
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~lgp171188/launchpad-bastion-scripts:staging-restore-use-the-primary-fqdn-for-all-operations into launchpad-bastion-scripts:main.
diff --git a/staging-restore/staging_restore.sh b/staging-restore/staging_restore.sh
index 4f10f2b..4762882 100755
--- a/staging-restore/staging_restore.sh
+++ b/staging-restore/staging_restore.sh
@@ -129,7 +129,7 @@ then
echo $(date) "Two replicated _new databases built" >> $LOGFILE
echo $(date) "Restore staging OAuth credentials" >> $LOGFILE
- in-model staging juju ssh launchpad-db-update/leader -- "sudo -iu launchpad psql -h database-ps5-1.staging.lp.internal -U migrationadmin -d lpmain_staging" < "$TOP/insert_oauth_credentials.sql" >> "$LOGFILE" 2>&1
+ in-model staging juju ssh launchpad-db-update/leader -- "sudo -iu launchpad psql -h lp-staging-pgbouncer.internal -U migrationadmin -d lpmain_staging" < "$TOP/insert_oauth_credentials.sql" >> "$LOGFILE" 2>&1
# Kill all connections to these DBs and then stop new connections
in-model staging juju ssh launchpad-db-update/leader -- "sudo -iu launchpad make -C ${ROOTDIR}/code/database/replication stagingswitch STAGING_CONFIG=launchpad-db-update STAGING_PGBOUNCER='psql -h lp-staging-pgbouncer.internal -p 5433 -U pgbouncer -d pgbouncer'" >> "$LOGFILE" 2>&1
@@ -143,22 +143,22 @@ then
# Now perform any DB tasks needed before the DB is re-opened
# 1) Let's turn off mirroring for non-bzrtools projects
echo $(date) "Turning off mirroring for non-bzrtools projects" >> $LOGFILE
- in-model staging juju ssh launchpad-db-update/leader -- "sudo -iu launchpad psql -h database-ps5-1.staging.lp.internal -U migrationadmin -d lpmain_staging" < "$TOP/disable_mirror.sql" >> $LOGFILE 2>&1
+ in-model staging juju ssh launchpad-db-update/leader -- "sudo -iu launchpad psql -h lp-staging-pgbouncer.internal -U migrationadmin -d lpmain_staging" < "$TOP/disable_mirror.sql" >> $LOGFILE 2>&1
# 2) Setup trac for checkwatches
echo $(date) "Setting up trac for checkwatches" >> $LOGFILE
- in-model staging juju ssh launchpad-db-update/leader -- "sudo -iu launchpad psql -h database-ps5-1.staging.lp.internal -U migrationadmin -d lpmain_staging" < "$TOP/checkwatches_trac.sql" >> $LOGFILE 2>&1
+ in-model staging juju ssh launchpad-db-update/leader -- "sudo -iu launchpad psql -h lp-staging-pgbouncer.internal -U migrationadmin -d lpmain_staging" < "$TOP/checkwatches_trac.sql" >> $LOGFILE 2>&1
# 3) Suspend code imports for staging
echo $(date) "Suspending code imports" >> $LOGFILE
- in-model staging juju ssh launchpad-db-update/leader -- "sudo -iu launchpad psql -h database-ps5-1.staging.lp.internal -U migrationadmin -d lpmain_staging" < "$TOP/suspend_code_imports.sql" >> $LOGFILE 2>&1
+ in-model staging juju ssh launchpad-db-update/leader -- "sudo -iu launchpad psql -h lp-staging-pgbouncer.internal -U migrationadmin -d lpmain_staging" < "$TOP/suspend_code_imports.sql" >> $LOGFILE 2>&1
# 4) Set production code import machines offline
echo $(date) "Setting production code import machines offline" >> $LOGFILE
- in-model staging juju ssh launchpad-db-update/leader -- "sudo -iu launchpad psql -h database-ps5-1.staging.lp.internal -U migrationadmin -d lpmain_staging" < "$TOP/set_production_code_import_machines_offline.sql" >> $LOGFILE 2>&1
+ in-model staging juju ssh launchpad-db-update/leader -- "sudo -iu launchpad psql -h lp-staging-pgbouncer.internal -U migrationadmin -d lpmain_staging" < "$TOP/set_production_code_import_machines_offline.sql" >> $LOGFILE 2>&1
# De-activate non-staging builders and set up staging scalingstack builders.
echo $(date) "Deactivating non-staging builders" >> $LOGFILE
- in-model staging juju ssh launchpad-db-update/leader -- "sudo -iu launchpad psql -h database-ps5-1.staging.lp.internal -U migrationadmin -d lpmain_staging" < "$TOP/staging_builders.sql" >> $LOGFILE 2>&1
+ in-model staging juju ssh launchpad-db-update/leader -- "sudo -iu launchpad psql -h lp-staging-pgbouncer.internal -U migrationadmin -d lpmain_staging" < "$TOP/staging_builders.sql" >> $LOGFILE 2>&1
# Disable all pending binary and recipe builds.
echo $(date) "Disabling pending builds" >> $LOGFILE
- in-model staging juju ssh launchpad-db-update/leader -- "sudo -iu launchpad psql -h database-ps5-1.staging.lp.internal -U migrationadmin -d lpmain_staging" < "$TOP/disable_builds.sql" >> $LOGFILE 2>&1
+ in-model staging juju ssh launchpad-db-update/leader -- "sudo -iu launchpad psql -h lp-staging-pgbouncer.internal -U migrationadmin -d lpmain_staging" < "$TOP/disable_builds.sql" >> $LOGFILE 2>&1
else