launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #20327
[Merge] lp:~wgrant/launchpad/bug-1475358-crash-harder into lp:launchpad
William Grant has proposed merging lp:~wgrant/launchpad/bug-1475358-crash-harder into lp:launchpad.
Commit message:
Uniquely index PackageDiff(from_source, to_source).
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~wgrant/launchpad/bug-1475358-crash-harder/+merge/293886
Uniquely index PackageDiff(from_source, to_source).
Package copies crash reliably on some packages due to duplicated PackageDiff rows (bug #1475358). Since model code assumes there's at most one PackageDiff for each (from_source, to_source) pair, let's enforce that in the DB schema. Copies will now crash during the race, fixable by retrying, instead of corrupting the DB and preventing any further copy attempts.
--
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wgrant/launchpad/bug-1475358-crash-harder into lp:launchpad.
=== added file 'database/schema/patch-2209-77-2.sql'
--- database/schema/patch-2209-77-2.sql 1970-01-01 00:00:00 +0000
+++ database/schema/patch-2209-77-2.sql 2016-05-05 12:42:04 +0000
@@ -0,0 +1,9 @@
+-- Copyright 2016 Canonical Ltd. This software is licensed under the
+-- GNU Affero General Public License version 3 (see the file LICENSE).
+
+SET client_min_messages=ERROR;
+
+CREATE UNIQUE INDEX packagediff__from_source__to_source__key
+ ON packagediff(from_source, to_source);
+
+INSERT INTO LaunchpadDatabaseRevision VALUES (2209, 77, 2);
Follow ups