migrations: Import principal applications first #6731

Merged
merged 1 commit into from Dec 19, 2016

Conversation

Projects
None yet
3 participants
Member

babbageclunk commented Dec 19, 2016

Otherwise the import fails because the subordinate units refer to
nonexistent principal units.

Fixes https://bugs.launchpad.net/juju/+bug/1650249

QA steps:

  • Bootstrap controllers A and B.
  • Add a model to A and deploy a subordinate charm (like ntp) and then a principal one (ubuntu), and relate them. Deploying the subordinate first makes it more likely that it will come first in the exported model.
  • Confirm that the subordinate app is before the principal one in juju dump-model.
  • Migrate the model from A to B - it should transfer successfully.
Member

babbageclunk commented Dec 19, 2016

Huh, that's irritating - I can never get it to fail like that locally. Ok, I'll change the test to marshal the model, reorder those elements and unmarshal.

Member

babbageclunk commented Dec 19, 2016

Came up with a nicer way to swap them.

!!chittychitty!!

state/migration_import_test.go
@@ -389,6 +389,71 @@ func (s *MigrationImportSuite) TestApplicationLeaders(c *gc.C) {
})
}
+func (s *MigrationImportSuite) TestApplications_SubordinatesAfter(c *gc.C) {
@perrito666

perrito666 Dec 19, 2016

Contributor

ditch the underscore please.

@babbageclunk

babbageclunk Dec 19, 2016

Member

Sure - although I think Katherine is advocating in the other direction.

migrations: Import principal applications first
Otherwise the import fails because the subordinate units refer to
nonexistent principal units.

Fixes https://bugs.launchpad.net/juju/+bug/1650249
Member

babbageclunk 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 2e110f2 into juju:develop Dec 19, 2016

@babbageclunk babbageclunk deleted the babbageclunk:mm-subordinate-charms branch Dec 19, 2016

jujubot added a commit that referenced this pull request Dec 19, 2016

Merge pull request #6734 from babbageclunk/mm-subordinate-charms-2.1
migrations: Import principal applications first (backport)

Otherwise the import fails because the subordinate units refer to
nonexistent principal units.

Fixes https://bugs.launchpad.net/juju/+bug/1650249

Backport of #6731 to 2.1 branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment