Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

state: infrastructure for synchronising state server upgrades #660

Merged
merged 1 commit into from Sep 4, 2014

Conversation

mjs
Copy link

@mjs mjs commented Sep 2, 2014

Introduce a new UpgradeInfo struct (and underlying mongo document) which will be used by state servers to synchronise tools upgrades.

Later commits will integrate this infrastructure with the upgrade machinery in jujud.

William Reade and Menno Smits both contributed to this revision.

for iter.Next(&doc) {
out = append(out, &UpgradeInfo{st: st, doc: doc})
}
if err := iter.Err(); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return out, iter.Err()

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I agree because what you suggest changes behaviour slightly. There's no guarantee that out will be nil if the iterator reports an error.

@mjs
Copy link
Author

mjs commented Sep 3, 2014

@davecheney: I'm not sure how to return a more meaningful error message when/if that txn.ErrAborted happens. The status being set in the wrong order could be due to a bug in caller, concurrent upgrades (which should never happen but hey) or multiple state servers attempting to set the state (only the master should be). It's impossible for this code to know what is the cause so I don't know how the error can be more detailed. I'm open to suggestions.

Note that this check really is a belts-and-braces sanity check. The error shouldn't happen in practice.

@davecheney
Copy link
Contributor

On Wed, Sep 3, 2014 at 1:15 PM, Menno Smits notifications@github.com
wrote:

@davecheney https://github.com/davecheney: I'm not sure how to return a
more meaningful error message when/if that txn.ErrAborted happens. The
status being set in the wrong order could be due to a bug in caller,
concurrent upgrades (which should never happen but hey) or multiple state
servers attempting to set the state (only the master should be). It's
impossible for this code to know what is the cause so I don't know how the
error can be more detailed. I'm open to suggestions.

All the cases appear to be a CAS failure, I want to update from A to B, but
when I went to do that the value wasn't A to begin with.

I think the best course of aciton is to guess, "unable to update upgrade
status from %v to %v. Another upgrade has run concurrently", before, after)

Note that this check really is a belts-and-braces sanity check. The error
shouldn't happen in practice.

famous last words


Reply to this email directly or view it on GitHub
#660 (comment).

@mjs mjs force-pushed the UpgradeInfo branch 2 times, most recently from ffac666 to 98b81ad Compare September 3, 2014 22:29
Introduce a new UpgradeInfo struct (and underlying mongo document)
which will be used by state servers to synchronise tools upgrades.

Later commits will integrate this infrastructure with the upgrade
machinery in jujud.

William Reade and Menno Smits both contributed to this revision.
@mjs
Copy link
Author

mjs commented Sep 3, 2014

$$merge$$

@jujubot
Copy link
Collaborator

jujubot commented Sep 3, 2014

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

@jujubot
Copy link
Collaborator

jujubot commented Sep 3, 2014

Build failed: Does not match ['fixes-1348477', 'fixes-1364410']
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/514

@mjs
Copy link
Author

mjs commented Sep 4, 2014

$$merge$$

@jujubot
Copy link
Collaborator

jujubot commented Sep 4, 2014

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

jujubot added a commit that referenced this pull request Sep 4, 2014
state: infrastructure for synchronising state server upgrades

Introduce a new UpgradeInfo struct (and underlying mongo document) which will be used by state servers to synchronise tools upgrades.

Later commits will integrate this infrastructure with the upgrade machinery in jujud.

William Reade and Menno Smits both contributed to this revision.
@jujubot jujubot merged commit 6654869 into juju:master Sep 4, 2014
@mjs mjs deleted the UpgradeInfo branch September 4, 2014 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants