Migration precheck for pending resources #6695

Merged
merged 4 commits into from Dec 14, 2016

Conversation

Projects
None yet
4 participants
Contributor

mjs commented Dec 12, 2016

Don't allow a migration to proceed if a resource is pending. A resource is pending if it is in the process of being added or downloaded (i.e. immediately after deploy or is being downloaded). The pending state is typically short-lived.

QA

It is difficult to intentionally hit the pending state itself so a migration with 2 resource using applications was done to ensure there hasn't been a regression.

mjs added some commits Dec 12, 2016

state: Expose listing of pending resources
This is required for a migrations precheck.
migration: Block migration if resources pending
A resource is pending if it is in the process of being added or
downloaded (i.e. immediately after deploy or being downloaded by a
unit). Migrations shouldn't proceed if this is the case.
- return &precheckShim{st}, nil
+ rSt, err := st.Resources()
+ if err != nil {
+ st.Close()
@anastasiamac

anastasiamac Dec 12, 2016

Member

So we close state if we encounter an error here... Where do we close it if we succeed? I have not seen any close calls.. but may be I just don't have eagle eyes :)

@mjs

mjs Dec 13, 2016

Contributor

It's up to the caller to call Close on the returned PrecheckBackendCloser. This ends up calling Close on the embedded State.

Contributor

mjs commented Dec 13, 2016

$$merge$$

Contributor

jujubot commented Dec 13, 2016

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

Contributor

jujubot commented Dec 13, 2016

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

cmd/jujud/agent: Registers components in tests
Required to support migrationmaster worker.
Contributor

mjs commented Dec 14, 2016

$$merge$$

Contributor

jujubot commented Dec 14, 2016

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

@jujubot jujubot merged commit ee6fdda into juju:2.1 Dec 14, 2016

@mjs mjs deleted the mjs:MM-pending-resources branch Dec 14, 2016

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

Merge pull request #6714 from mjs/MM-pending-resources-develop
Migration precheck for pending resources

Don't allow a migration to proceed if a resource is pending. A resource is pending if it is in the process of being added or downloaded (i.e. immediately after deploy or is being downloaded). The pending state is typically short-lived.

This is a forward port of #6695.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment