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
Conversation
for iter.Next(&doc) { | ||
out = append(out, &UpgradeInfo{st: st, doc: doc}) | ||
} | ||
if err := iter.Err(); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return out, iter.Err()
There was a problem hiding this comment.
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.
@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. |
On Wed, Sep 3, 2014 at 1:15 PM, Menno Smits notifications@github.com
I think the best course of aciton is to guess, "unable to update upgrade
|
ffac666
to
98b81ad
Compare
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.
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
Build failed: Does not match ['fixes-1348477', 'fixes-1364410'] |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
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.
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.