Merge lp:~cjwatson/launchpad/db-process-accepted-bugs-job into lp:launchpad/db-devel

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: no longer in the source branch.
Merged at revision: 11843
Proposed branch: lp:~cjwatson/launchpad/db-process-accepted-bugs-job
Merge into: lp:launchpad/db-devel
Diff against target: 140 lines (+51/-6)
5 files modified
database/sampledata/current-dev.sql (+14/-3)
database/sampledata/current.sql (+14/-3)
database/schema/comments.sql (+8/-0)
database/schema/patch-2209-27-2.sql (+13/-0)
database/schema/security.cfg (+2/-0)
To merge this branch: bzr merge lp:~cjwatson/launchpad/db-process-accepted-bugs-job
Reviewer Review Type Date Requested Status
Stuart Bishop (community) db Approve
Benji York (community) code Approve
Robert Collins db Pending
Review via email: mp+119320@code.launchpad.net

Commit message

Add ProcessAcceptedBugsJob table.

Description of the change

== Summary ==

Bug 745799: Some uploads can't be accepted within the timeout, principally because they have to close lots of bugs and dealing with structural subscriptions is very slow.

== Proposed fix ==

I describe my proposed fix in detail in https://bugs.launchpad.net/launchpad/+bug/745799/comments/20. We aren't likely to be able to solve the structural subscription problem any time soon, and uploads can close arbitrarily large numbers of bugs, so in order to get rid of the queue script in Launchpad (the only remaining purpose of which is to work around timeouts with processing some uploads) we need to move bug processing to run asynchronously.

This is the DB part of this change.

== Pre-implementation notes ==

http://irclogs.ubuntu.com/2012/08/04/%23launchpad-dev.html#t01:49

== LOC Rationale ==

+46, depending on how you want to count DB changes. Even with the associated code changes, this will still be dwarfed by removing the queue script (-1956).

To post a comment you must log in.
Revision history for this message
Benji York (benji) wrote :

The code in this branch is perfect in every way.

review: Approve (code)
Revision history for this message
Colin Watson (cjwatson) wrote :

Sorry, I hadn't actually meant to ask for a code review but couldn't withdraw the request once I'd made it :-)

Revision history for this message
Stuart Bishop (stub) wrote :

This is fine.

It would be nice to drop the id column and just use job as the primary key, but I understand that we probably have existing code that relies on id and the table should be small in any case.

review: Approve (db)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'database/sampledata/current-dev.sql'
--- database/sampledata/current-dev.sql 2012-08-03 19:21:19 +0000
+++ database/sampledata/current-dev.sql 2012-08-16 15:24:31 +0000
@@ -762,9 +762,6 @@
762762
763763
764764
765
766
767
768SET SESSION AUTHORIZATION DEFAULT;765SET SESSION AUTHORIZATION DEFAULT;
769766
770ALTER TABLE account DISABLE TRIGGER ALL;767ALTER TABLE account DISABLE TRIGGER ALL;
@@ -3535,6 +3532,13 @@
3535ALTER TABLE bugsubscriptionfilterimportance ENABLE TRIGGER ALL;3532ALTER TABLE bugsubscriptionfilterimportance ENABLE TRIGGER ALL;
35363533
35373534
3535ALTER TABLE bugsubscriptionfilterinformationtype DISABLE TRIGGER ALL;
3536
3537
3538
3539ALTER TABLE bugsubscriptionfilterinformationtype ENABLE TRIGGER ALL;
3540
3541
3538ALTER TABLE bugsubscriptionfiltermute DISABLE TRIGGER ALL;3542ALTER TABLE bugsubscriptionfiltermute DISABLE TRIGGER ALL;
35393543
35403544
@@ -9013,6 +9017,13 @@
9013ALTER TABLE potranslation ENABLE TRIGGER ALL;9017ALTER TABLE potranslation ENABLE TRIGGER ALL;
90149018
90159019
9020ALTER TABLE processacceptedbugsjob DISABLE TRIGGER ALL;
9021
9022
9023
9024ALTER TABLE processacceptedbugsjob ENABLE TRIGGER ALL;
9025
9026
9016ALTER TABLE productjob DISABLE TRIGGER ALL;9027ALTER TABLE productjob DISABLE TRIGGER ALL;
90179028
90189029
90199030
=== modified file 'database/sampledata/current.sql'
--- database/sampledata/current.sql 2012-08-03 19:21:19 +0000
+++ database/sampledata/current.sql 2012-08-16 15:24:31 +0000
@@ -762,9 +762,6 @@
762762
763763
764764
765
766
767
768SET SESSION AUTHORIZATION DEFAULT;765SET SESSION AUTHORIZATION DEFAULT;
769766
770ALTER TABLE account DISABLE TRIGGER ALL;767ALTER TABLE account DISABLE TRIGGER ALL;
@@ -3469,6 +3466,13 @@
3469ALTER TABLE bugsubscriptionfilterimportance ENABLE TRIGGER ALL;3466ALTER TABLE bugsubscriptionfilterimportance ENABLE TRIGGER ALL;
34703467
34713468
3469ALTER TABLE bugsubscriptionfilterinformationtype DISABLE TRIGGER ALL;
3470
3471
3472
3473ALTER TABLE bugsubscriptionfilterinformationtype ENABLE TRIGGER ALL;
3474
3475
3472ALTER TABLE bugsubscriptionfiltermute DISABLE TRIGGER ALL;3476ALTER TABLE bugsubscriptionfiltermute DISABLE TRIGGER ALL;
34733477
34743478
@@ -8936,6 +8940,13 @@
8936ALTER TABLE potranslation ENABLE TRIGGER ALL;8940ALTER TABLE potranslation ENABLE TRIGGER ALL;
89378941
89388942
8943ALTER TABLE processacceptedbugsjob DISABLE TRIGGER ALL;
8944
8945
8946
8947ALTER TABLE processacceptedbugsjob ENABLE TRIGGER ALL;
8948
8949
8939ALTER TABLE productjob DISABLE TRIGGER ALL;8950ALTER TABLE productjob DISABLE TRIGGER ALL;
89408951
89418952
89428953
=== modified file 'database/schema/comments.sql'
--- database/schema/comments.sql 2012-07-31 20:35:05 +0000
+++ database/schema/comments.sql 2012-08-16 15:24:31 +0000
@@ -715,6 +715,14 @@
715COMMENT ON COLUMN PreviewDiff.target_revision_id IS 'The target branch revision_id used to generate this diff.';715COMMENT ON COLUMN PreviewDiff.target_revision_id IS 'The target branch revision_id used to generate this diff.';
716716
717717
718-- ProcessAcceptedBugsJob
719COMMENT ON TABLE ProcessAcceptedBugsJob IS 'Contains references to jobs for modifying bugs in response to accepting package uploads.';
720COMMENT ON COLUMN ProcessAcceptedBugsJob.job IS 'The Job related to this ProcessAcceptedBugsJob.';
721COMMENT ON COLUMN ProcessAcceptedBugsJob.distroseries IS 'The DistroSeries of the accepted upload.';
722COMMENT ON COLUMN ProcessAcceptedBugsJob.sourcepackagerelease IS 'The SourcePackageRelease of the accepted upload.';
723COMMENT ON COLUMN ProcessAcceptedBugsJob.json_data IS 'A JSON struct containing data for the job.';
724
725
718-- Product726-- Product
719COMMENT ON TABLE Product IS 'Product: a DOAP Product. This table stores core information about an open source product. In Launchpad, anything that can be shipped as a tarball would be a product, and in some cases there might be products for things that never actually ship, depending on the project. For example, most projects will have a ''website'' product, because that allows you to file a Malone bug against the project website. Note that these are not actual product releases, which are stored in the ProductRelease table.';727COMMENT ON TABLE Product IS 'Product: a DOAP Product. This table stores core information about an open source product. In Launchpad, anything that can be shipped as a tarball would be a product, and in some cases there might be products for things that never actually ship, depending on the project. For example, most projects will have a ''website'' product, because that allows you to file a Malone bug against the project website. Note that these are not actual product releases, which are stored in the ProductRelease table.';
720COMMENT ON COLUMN Product.owner IS 'The Product owner would typically be the person who created this product in Launchpad. But we will encourage the upstream maintainer of a product to become the owner in Launchpad. The Product owner can edit any aspect of the Product, as well as appointing people to specific roles with regard to the Product. Also, the owner can add a new ProductRelease and also edit Rosetta POTemplates associated with this product.';728COMMENT ON COLUMN Product.owner IS 'The Product owner would typically be the person who created this product in Launchpad. But we will encourage the upstream maintainer of a product to become the owner in Launchpad. The Product owner can edit any aspect of the Product, as well as appointing people to specific roles with regard to the Product. Also, the owner can add a new ProductRelease and also edit Rosetta POTemplates associated with this product.';
721729
=== added file 'database/schema/patch-2209-27-2.sql'
--- database/schema/patch-2209-27-2.sql 1970-01-01 00:00:00 +0000
+++ database/schema/patch-2209-27-2.sql 2012-08-16 15:24:31 +0000
@@ -0,0 +1,13 @@
1-- Copyright 2012 Canonical Ltd. This software is licensed under the
2-- GNU Affero General Public License version 3 (see the file LICENSE).
3
4SET client_min_messages=ERROR;
5
6CREATE TABLE ProcessAcceptedBugsJob (
7 job integer PRIMARY KEY REFERENCES Job ON DELETE CASCADE UNIQUE NOT NULL,
8 distroseries integer REFERENCES DistroSeries NOT NULL,
9 sourcepackagerelease integer REFERENCES SourcePackageRelease NOT NULL,
10 json_data text
11);
12
13INSERT INTO LaunchpadDatabaseRevision VALUES (2209, 27, 2);
014
=== modified file 'database/schema/security.cfg'
--- database/schema/security.cfg 2012-08-06 03:47:42 +0000
+++ database/schema/security.cfg 2012-08-16 15:24:31 +0000
@@ -266,6 +266,7 @@
266public.polloption = SELECT, INSERT, UPDATE, DELETE266public.polloption = SELECT, INSERT, UPDATE, DELETE
267public.potexport = SELECT267public.potexport = SELECT
268public.previewdiff = SELECT, INSERT, UPDATE, DELETE268public.previewdiff = SELECT, INSERT, UPDATE, DELETE
269public.processacceptedbugsjob = SELECT, INSERT, UPDATE, DELETE
269public.productjob = SELECT, INSERT, UPDATE, DELETE270public.productjob = SELECT, INSERT, UPDATE, DELETE
270public.productrelease = SELECT, INSERT, UPDATE, DELETE271public.productrelease = SELECT, INSERT, UPDATE, DELETE
271public.productreleasefile = SELECT, INSERT, DELETE272public.productreleasefile = SELECT, INSERT, DELETE
@@ -1521,6 +1522,7 @@
1521[process_accepted]1522[process_accepted]
1522type=user1523type=user
1523groups=queued1524groups=queued
1525public.processacceptedbugsjob = SELECT, INSERT
15241526
1525[session]1527[session]
1526type=user1528type=user

Subscribers

People subscribed via source and target branches

to status/vote changes: