← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~stub/launchpad/db-deploy into lp:launchpad

 

Stuart Bishop has proposed merging lp:~stub/launchpad/db-deploy into lp:launchpad.

Requested reviews:
  Stuart Bishop (stub)
Related bugs:
  Bug #906222 in Launchpad itself: "More BAD_USERS creating false positives during fast downtime updates"
  https://bugs.launchpad.net/launchpad/+bug/906222
  Bug #911417 in Launchpad itself: "Staging db restore fails on make -C database/replication stagingsetup"
  https://bugs.launchpad.net/launchpad/+bug/911417
  Bug #1025396 in Launchpad itself: "deployment scripts need to cope with streaming replication"
  https://bugs.launchpad.net/launchpad/+bug/1025396
  Bug #1025399 in Launchpad itself: "full-update.py should wait for streaming slaves before completing"
  https://bugs.launchpad.net/launchpad/+bug/1025399
  Bug #1036694 in Launchpad itself: "security.py still references slony"
  https://bugs.launchpad.net/launchpad/+bug/1036694

For more details, see:
https://code.launchpad.net/~stub/launchpad/db-deploy/+merge/126184

= Summary =

The fast downtime database update can be sped further.

== Proposed fix ==

Don't apply comments.sql, about 1600 SQL statements.

== 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/schema/upgrade.py
  database/schema/full-update.py

./database/schema/upgrade.py
      12: '_pythonpath' imported but unused
./database/schema/full-update.py
       7: '_pythonpath' imported but unused
-- 
https://code.launchpad.net/~stub/launchpad/db-deploy/+merge/126184
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.
=== modified file 'database/schema/full-update.py'
--- database/schema/full-update.py	2012-09-20 13:04:44 +0000
+++ database/schema/full-update.py	2012-09-25 08:15:26 +0000
@@ -39,6 +39,7 @@
     # applied in the same transaction.
     options.commit = False
     options.partial = False
+    options.comments = False  # Saves about 1s. Apply comments manually.
     # Invoke the database schema upgrade process.
     try:
         return upgrade.main(master_con)

=== modified file 'database/schema/upgrade.py'
--- database/schema/upgrade.py	2012-09-20 10:55:12 +0000
+++ database/schema/upgrade.py	2012-09-25 08:15:26 +0000
@@ -240,7 +240,10 @@
 
 
 def apply_comments(con):
-    apply_other(con, 'comments.sql')
+    if options.comments:
+        apply_other(con, 'comments.sql')
+    else:
+        log.debug("Skipping comments.sql per command line settings")
 
 
 _bzr_details_cache = None
@@ -275,6 +278,9 @@
     parser.add_option(
         "--partial", dest="partial", default=False,
         action="store_true", help="Commit after applying each patch")
+    parser.add_option(
+        "--skip-comments", dest="comments", default=True,
+        action="store_false", help="Skip applying comments.sql")
     (options, args) = parser.parse_args()
 
     if args:


Follow ups