~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to database/schema/full-update.py

[r=stub][no-qa] Report outage time of fastdowntime deploy and
 increase responsiveness of staging slony

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 
7
7
import _pythonpath
8
8
 
 
9
from datetime import datetime
9
10
from optparse import OptionParser
10
11
import subprocess
11
12
import sys
125
126
    upgrade_run = False
126
127
    security_run = False
127
128
 
 
129
    outage_start = datetime.now()
 
130
 
128
131
    try:
129
132
        # Shutdown pgbouncer
130
133
        log.info("Outage starts. Shutting down pgbouncer.")
157
160
            log.fatal("pgbouncer not restarted [%s]", pgbouncer_rc)
158
161
            return pgbouncer_rc
159
162
        pgbouncer_down = False
160
 
        log.info("Outage complete.")
 
163
        log.info("Outage complete. %s", datetime.now() - outage_start)
161
164
 
162
165
        # We will start seeing connections as soon as pgbouncer is
163
166
        # reenabled, so ignore them here.
185
188
            pgbouncer_rc = run_pgbouncer(log, 'start')
186
189
            if pgbouncer_rc == 0:
187
190
                log.info("Despite failures, pgbouncer restarted.")
188
 
                log.info("Outage complete.")
 
191
                log.info("Outage complete. %s", datetime.now() - outage_start)
189
192
            else:
190
193
                log.fatal("pgbouncer is down and refuses to restart")
191
194
        if not upgrade_run: