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

Proposed by Stuart Bishop
Status: Merged
Approved by: Stuart Bishop
Approved revision: 13518
Merged at revision: 15585
Proposed branch: lp:~stub/launchpad/staging
Merge into: lp:launchpad
Diff against target: 31 lines (+6/-1)
1 file modified
database/replication/Makefile (+6/-1)
To merge this branch: bzr merge lp:~stub/launchpad/staging
Reviewer Review Type Date Requested Status
Stuart Bishop (community) Approve
Review via email: mp+114009@code.launchpad.net

Description of the change

= 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.

To post a comment you must log in.
Revision history for this message
Stuart Bishop (stub) wrote :

Bit of a hack, but good enough until we build this into our db patch deployment tools.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'database/replication/Makefile'
2--- database/replication/Makefile 2012-07-01 07:06:13 +0000
3+++ database/replication/Makefile 2012-07-09 17:11:28 +0000
4@@ -34,6 +34,8 @@
5 DOGFOOD_DBNAME=launchpad_dogfood
6 DOGFOOD_DUMP=launchpad.dump
7
8+STAGING_PGBOUNCER=psql -p 6432 -U pgbouncer -d pgbouncer
9+
10 PGMASSACRE=../../utilities/pgmassacre.py
11
12 CREATEDB=createdb --encoding=UTF8 --locale=C --template=template0
13@@ -52,6 +54,8 @@
14 # place.
15 stagingsetup: DUMPLIST:=$(shell tempfile --suffix=.lst --prefix=lpstag)
16 stagingsetup:
17+ ${STAGING_PGBOUNCER} -c 'kill launchpad_staging'
18+ ${STAGING_PGBOUNCER} -c 'kill launchpad_staging_slave'
19 -${PGMASSACRE} lpmain_staging
20 # Create the DB with the desired default tablespace.
21 ${CREATEDB} --tablespace ${STAGING_TABLESPACE} lpmain_staging
22@@ -72,7 +76,8 @@
23 --log-file=INFO:${STAGING_LOGDIR}/dbupgrade.log
24 @echo Setting feature flags
25 psql -d lpmain_staging -c "INSERT INTO featureflag (flag, scope, priority, value) VALUES ('profiling.enabled', 'team:launchpad', 0, 'on')"
26-
27+ ${STAGING_PGBOUNCER} -c 'resume launchpad_staging'
28+ ${STAGING_PGBOUNCER} -c 'resume launchpad_staging_slave'
29
30 stagingswitch:
31 echo Nothing to do. Staging already built inplace.