Store separate migration attempt number #6715

Merged
merged 2 commits into from Dec 19, 2016

Conversation

Projects
None yet
3 participants
Contributor

mjs commented Dec 15, 2016

In order to allow correct sorting of migration documents when there's been 10 or more attempts (note: 2 digits), the attempt number is now stored in a separate document field. This also simplifies the Attempt()
API, negating the need for an error return.

Upgrade step for preexisting migration documents included.

QA

Ran a migration and confirmed by DB inspection that an attempt field was on the migration document. Then manually removed the field, modified the upgradedToVersion in the controller's agent.conf and restarted the controller agent to trigger upgrade steps to run. Inspecting the DB again showed that the correct attempt field had been added.

Contributor

mjs commented Dec 15, 2016

$$merge$$

Contributor

jujubot commented Dec 15, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

Contributor

jujubot commented Dec 15, 2016

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/9887

Contributor

mjs commented Dec 15, 2016

$$merge$$

Contributor

jujubot commented Dec 15, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

@mjs mjs closed this Dec 15, 2016

@mjs mjs deleted the mjs:MM-migration-sorting branch Dec 15, 2016

@mjs mjs restored the mjs:MM-migration-sorting branch Dec 15, 2016

@mjs mjs reopened this Dec 15, 2016

Contributor

jujubot commented Dec 15, 2016

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/9893

mjs added some commits Dec 15, 2016

Store separate migration attempt number
In order to allow correct sorting of migration documents when there's
been 10 or more attempts (note: 2 digits), the attempt number is now
stored in a separate document field. This also simplifies the Attempt()
API, negating the need for an error return.
Upgrade step to add "attempt" to migration docs
Migration docs now have an integer "attempt" column. The upgrade step
populates these by parsing the doc _id.
Contributor

mjs commented Dec 19, 2016

$$merge$$

Contributor

jujubot commented Dec 19, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

@jujubot jujubot merged commit 6d421fb into juju:2.1 Dec 19, 2016

@mjs mjs deleted the mjs:MM-migration-sorting branch Jan 7, 2017

jujubot added a commit that referenced this pull request Jan 7, 2017

Merge pull request #6780 from mjs/MM-migration-sorting-develop
Store separate migration attempt number

This is a forward port of #6715.

In order to allow correct sorting of migration documents when there's been 10 or more attempts (note: 2 digits), the attempt number is now stored in a separate document field. This also simplifies the Attempt()
API, negating the need for an error return.

Upgrade step for preexisting migration documents included.

### QA 

Ran a migration and confirmed by DB inspection that an attempt field was on the migration document. Then manually removed the field, modified the upgradedToVersion in the controller's agent.conf and restarted the controller agent to trigger upgrade steps to run. Inspecting the DB again showed that the correct attempt field had been added.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment