Merge lp:~stub/launchpad/pending-db-changes into lp:launchpad/db-devel
Proposed by
Stuart Bishop
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 9445 | ||||
Proposed branch: | lp:~stub/launchpad/pending-db-changes | ||||
Merge into: | lp:launchpad/db-devel | ||||
Diff against target: |
127 lines (+35/-17) 4 files modified
database/replication/helpers.py (+10/-4) database/schema/fti.py (+10/-13) database/schema/patch-2207-62-0.sql (+14/-0) database/schema/security.cfg (+1/-0) |
||||
To merge this branch: | bzr merge lp:~stub/launchpad/pending-db-changes | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michael Nelson (community) | code | Approve | |
Review via email: mp+27263@code.launchpad.net |
Commit message
SourcePackageRe
Description of the change
Collection of minor DB tweaks.
We have stopped replicating the OAuthNonce table, and tweaks to our replication maintenance scripts to stop it being added back.
fti.py was spitting a deprecation warning under Python 2.6 - fix that.
The Bug #49717 DB patch I though had been landed had not been landed. Extend this with a tweak for the OAuthNonce table, so things still cope now it is no longer replicated.
A DB permission for our nagios checks.
To post a comment you must log in.
Hi Stuart,
Just a few notes below. The main one I'm interested in is whether we should include the BuildFarmJob.status index in the db patch.
Thanks!
> === modified file 'database/ replication/ helpers. py' replication/ helpers. py 2010-04-29 12:38:05 +0000 replication/ helpers. py 2010-06-10 13:40:07 +0000 namespace, tablename)) tables. add(key)
> --- database/
> +++ database/
> @@ -420,7 +424,8 @@
> """ % sqlvalues(
> for namespace, tablename in cur.fetchall():
> key = (namespace, tablename)
> - if key not in tables and key not in pending_tables:
> + if (key not in tables and key not in pending_tables
> + and '%s.%s' % (namespace, tablename) not in IGNORED_TABLES):
> pending_
Just out of interest, this kind of change (or these helpers) *could* be tested couldn't they?
> fqn(namespace, tablename), namespace, tablename)) add(row[ 0])
> # Generate the set of sequences that are linked to any of our set of
> @@ -441,8 +446,9 @@
> ) AS whatever
> WHERE seq IS NOT NULL;
> """ % sqlvalues(
> - for row in cur.fetchall():
> - sequences.
> + for sequence, in cur.fetchall():
Nice, but would it be clearer to do:
for sequence, whateverelse in cur.fetchall():
using something appropriate?
? add(sequence) schema/ fti.py' schema/ fti.py 2010-05-19 18:07:56 +0000 schema/ fti.py 2010-06-10 13:40:07 +0000 min_messages= ERROR;" sql_path) .read() .replace( s.PIPE, subprocess. PIPE, stderr= subprocess. STDOUT) min_messages= ERROR; CREATE SCHEMA ts2;" sql_path) .read() .replace( 'public; ','ts2, public;')) p.fromchild. read())
> + if sequence not in IGNORED_SEQUENCES:
> + sequences.
>
> # We can't easily convert the sequence name to (namespace, name) tuples,
> # so we might as well convert the tables to dot notation for consistancy.
>
> === modified file 'database/
> --- database/
> +++ database/
> @@ -319,18 +319,15 @@
> cmd += ' -h %s' % lp.dbhost
> if options.dbuser:
> cmd += ' -U %s' % options.dbuser
> - p = popen2.Popen4(cmd)
> - c = p.tochild
> - print >> c, "SET client_
> - print >> c, "CREATE SCHEMA ts2;"
> - print >> c, open(tsearch2_
> - 'public;','ts2, public;'
> - )
> - p.tochild.close()
> - rv = p.wait()
> - if rv != 0:
> + p = subprocess.Popen(
> + cmd.split(' '), stdin=subproces
> + stdout=
> + out, err = p.communicate(
> + "SET client_
> + + open(tsearch2_
> + if p.returncode != 0:
> log.fatal('Error executing %s:', cmd)
> - log.debug(
> + log.debug(out)
Is err not useful here?
> sys.exit(rv) schema/ patch-2207- 62-0.sql' schema/ patch-2207- 62-0.sql 1970-01-01 00:00:00 +0000 schema/ patch-2207- 62-0.sql 2010-06-10 13:40:07 +0000 min_messages= ERROR; le...
>
> # Create ftq helper and its sibling _ftq.
>
> === added file 'database/
> --- database/
> +++ database/
> @@ -0,0 +1,14 @@
> +SET client_
> +
> +-- Bug #49717
> +ALTER TABLE SourcePackageRe