Merge lp:~wgrant/launchpad/ppa-reset-2.0-db into lp:launchpad/db-devel

Proposed by William Grant
Status: Merged
Merged at revision: 12710
Proposed branch: lp:~wgrant/launchpad/ppa-reset-2.0-db
Merge into: lp:launchpad/db-devel
Diff against target: 16 lines (+12/-0)
1 file modified
database/schema/patch-2209-57-0.sql (+12/-0)
To merge this branch: bzr merge lp:~wgrant/launchpad/ppa-reset-2.0-db
Reviewer Review Type Date Requested Status
Stuart Bishop (community) db Approve
Launchpad code reviewers Pending
Review via email: mp+223395@code.launchpad.net

Commit message

Add Builder.clean_status, vm_reset_protocol and date_clean_status_changed for the virtual builder reset protocol 2.0.

Description of the change

Add new database columns to implement the Launchpad virtual builder reset protocol 2.0 for Scalingstack (described in https://docs.google.com/a/canonical.com/document/d/1SfJ9jA0_l_8iryANEkhe2HE5mMTRy-zcz6t_UBce7Vw/edit). VM resets in the new protocol are no longer synchronous during dispatching, but asynchronous before a dispatch is even considered, so we need to persist additional state.

The schema will evolve in future as our builder model grows cloudier, and with some luck the clean_status column will be dead before the year is out. But it remains to be seen exactly how it should be replaced, so it will do for now.

A new protocol version enum column has been added, as well as a clean_status column to track whether a slave is currently CLEAN, DIRTY or CLEANING. Wherever the cleanliness is in question, it fails safe to DIRTY. There's also a timestamp of the most recent clean_status change, to let us more easily track when things are stuck.

https://code.launchpad.net/~wgrant/launchpad/ppa-reset-2.0-model/+merge/223396 has the initial model code, and https://code.launchpad.net/~wgrant/launchpad/ppa-reset-2.0-basics/+merge/223397 ports the virt 1.1 and non-virt protocols to the new model.

To post a comment you must log in.
Revision history for this message
Stuart Bishop (stub) wrote :

All good.

review: Approve (db)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'database/schema/patch-2209-57-0.sql'
2--- database/schema/patch-2209-57-0.sql 1970-01-01 00:00:00 +0000
3+++ database/schema/patch-2209-57-0.sql 2014-06-17 12:41:31 +0000
4@@ -0,0 +1,12 @@
5+-- Copyright 2014 Canonical Ltd. This software is licensed under the
6+-- GNU Affero General Public License version 3 (see the file LICENSE).
7+
8+SET client_min_messages=ERROR;
9+
10+ALTER TABLE builder
11+ ADD COLUMN clean_status integer NOT NULL DEFAULT 1,
12+ ADD COLUMN vm_reset_protocol integer,
13+ ADD COLUMN date_clean_status_changed timestamp without time zone
14+ NOT NULL DEFAULT (CURRENT_TIMESTAMP AT TIME ZONE 'UTC');
15+
16+INSERT INTO LaunchpadDatabaseRevision VALUES (2209, 57, 0);

Subscribers

People subscribed via source and target branches

to status/vote changes: