← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~stub/launchpad/staging into lp:launchpad

 

Stuart Bishop has proposed merging lp:~stub/launchpad/staging into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~stub/launchpad/staging/+merge/114009

= Summary =

Staging database rebuilds currently need manual love to disable connections from the clients.

== Proposed fix ==

Automatically connect to pgbouncer to disable connections and reenable them.

== Pre-implementation notes ==

== LOC Rationale ==

== Implementation details ==


== Tests ==

== Demo and Q/A ==


= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  database/replication/Makefile

./database/replication/Makefile
      78: Line exceeds 80 characters.
-- 
https://code.launchpad.net/~stub/launchpad/staging/+merge/114009
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stub/launchpad/staging into lp:launchpad.
=== modified file 'database/replication/Makefile'
--- database/replication/Makefile	2012-07-01 07:06:13 +0000
+++ database/replication/Makefile	2012-07-09 17:07:34 +0000
@@ -34,6 +34,8 @@
 DOGFOOD_DBNAME=launchpad_dogfood
 DOGFOOD_DUMP=launchpad.dump
 
+STAGING_PGBOUNCER=psql -p 6432 -U pgbouncer -d pgbouncer
+
 PGMASSACRE=../../utilities/pgmassacre.py
 
 CREATEDB=createdb --encoding=UTF8 --locale=C --template=template0
@@ -52,6 +54,8 @@
 # place.
 stagingsetup: DUMPLIST:=$(shell tempfile --suffix=.lst --prefix=lpstag)
 stagingsetup:
+	${STAGING_PGBOUNCER} -c 'kill launchpad_staging'
+	${STAGING_PGBOUNCER} -c 'kill launchpad_staging_slave'
 	-${PGMASSACRE} lpmain_staging
 	# Create the DB with the desired default tablespace.
 	${CREATEDB} --tablespace ${STAGING_TABLESPACE} lpmain_staging
@@ -72,7 +76,8 @@
 	    --log-file=INFO:${STAGING_LOGDIR}/dbupgrade.log
 	@echo Setting feature flags
 	psql -d lpmain_staging -c "INSERT INTO featureflag (flag, scope, priority, value) VALUES ('profiling.enabled', 'team:launchpad', 0, 'on')"
-
+	${STAGING_PGBOUNCER} -c 'resume launchpad_staging'
+	${STAGING_PGBOUNCER} -c 'resume launchpad_staging_slave'
 
 stagingswitch:
 	echo Nothing to do. Staging already built inplace.


Follow ups