← 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:
  Launchpad code reviewers (launchpad-reviewers)
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/119714

= Summary =

Spurious warnings during updates are spurious.

== Proposed fix ==

Pull out the remaining (?) Slony support.

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

./database/schema/security.py
       8: '_pythonpath' imported but unused
      17: 'psycopg2' imported but unused
./database/schema/full-update.py
       7: '_pythonpath' imported but unused
-- 
https://code.launchpad.net/~stub/launchpad/db-deploy/+merge/119714
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stub/launchpad/db-deploy into lp:launchpad.
=== modified file 'database/schema/full-update.py'
--- database/schema/full-update.py	2012-08-07 10:38:36 +0000
+++ database/schema/full-update.py	2012-08-15 13:46:21 +0000
@@ -79,7 +79,6 @@
     options.dryrun = False
     options.revoke = True
     options.owner = 'postgres'
-    options.cluster = True
     security.options = options
     security.log = log
     # Invoke the database security reset process.

=== modified file 'database/schema/security.py'
--- database/schema/security.py	2012-01-25 06:02:40 +0000
+++ database/schema/security.py	2012-08-15 13:46:21 +0000
@@ -14,8 +14,6 @@
 import os
 import sys
 
-import psycopg2
-
 from fti import quote_identifier
 from lp.services.database.sqlbase import connect
 from lp.services.scripts import (
@@ -23,7 +21,6 @@
     logger,
     logger_options,
     )
-import replication.helpers
 
 # The 'read' group does not get given select permission on the following
 # tables. This is to stop the ro user being given access to secrurity
@@ -243,20 +240,7 @@
 
     con = connect()
 
-    if options.cluster:
-        nodes = replication.helpers.get_nodes(con, 1)
-        if nodes:
-            # If we have a replicated environment, reset permissions on all
-            # Nodes.
-            con.close()
-            for node in nodes:
-                log.info("Resetting permissions on %s (%s)" % (
-                    node.nickname, node.connection_string))
-                reset_permissions(
-                    psycopg2.connect(node.connection_string), config, options)
-            return 0
-        log.warning("--cluster requested, but not a Slony-I cluster.")
-    log.info("Resetting permissions on single database")
+    log.info("Resetting permissions.")
     reset_permissions(con, config, options)
     return 0
 
@@ -676,10 +660,6 @@
     parser.add_option(
         "-o", "--owner", dest="owner", default="postgres",
         help="Owner of PostgreSQL objects")
-    parser.add_option(
-        "-c", "--cluster", dest="cluster", default=False,
-        action="store_true",
-        help="Rebuild permissions on all nodes in the Slony-I cluster.")
     db_options(parser)
     logger_options(parser)
 


Follow ups