Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1852)

Issue 19000043: worker/upgrader: check for tools before getting

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 6 months ago by jameinel
Modified:
10 years, 6 months ago
Reviewers:
mp+193008, john2, dimitern, rog
Visibility:
Public.

Description

worker/upgrader: check for tools before getting When we moved Upgrader behind the API, we lost one of the checks that it was doing. Namely, when it saw that an upgrade was requested, it used to check if we already had that version of the tools available. This restores that check. I noticed this while doing scale testing. If you have 1000 units all trying to upgrade at the same time on a machine, you end up consuming 4.5MB*1000 = 4.5GB of temporary Tar data, plus 20MB*1000=40GB of 'unpacking-' files. Which is more than my VMs have available :). There is still a race condition, if you have all of the Unit agents notice at the same time, they will still start trying to download concurrently. The only thing I could really do there would be to add a filesystem lock (like uniter-hook-execution). I looked into it, but it isn't very trivial to set up a fs hook correctly (in uniter.go there is a lot of code around checking the Tomb to see if we are stopping, if we held the lock before so we can break it now, etc.) I'd rather not get the fs locking wrong and end up in a situation where we deadlock trying to upgrade. https://code.launchpad.net/~jameinel/juju-core/read-before-download/+merge/193008 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 2

Patch Set 2 : worker/upgrader: check for tools before getting #

Unified diffs Side-by-side diffs Delta from patch set Stats (+28 lines, -2 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M worker/upgrader/export_test.go View 1 chunk +8 lines, -0 lines 0 comments Download
M worker/upgrader/upgrader.go View 1 2 chunks +6 lines, -2 lines 0 comments Download
M worker/upgrader/upgrader_test.go View 1 chunk +12 lines, -0 lines 0 comments Download

Messages

Total messages: 6
jameinel
Please take a look.
10 years, 6 months ago (2013-10-29 06:24:04 UTC) #1
dimitern
LGTM. At first I thought this fix is not really beneficial except for a very ...
10 years, 6 months ago (2013-10-30 13:46:03 UTC) #2
rog
LGTM with one small thought https://codereview.appspot.com/19000043/diff/1/worker/upgrader/upgrader.go File worker/upgrader/upgrader.go (right): https://codereview.appspot.com/19000043/diff/1/worker/upgrader/upgrader.go#newcode177 worker/upgrader/upgrader.go:177: if _, err := ...
10 years, 6 months ago (2013-10-30 18:03:29 UTC) #3
jameinel
Please take a look.
10 years, 6 months ago (2013-10-31 05:26:35 UTC) #4
john2
On 2013/10/30 13:46:03, dimitern wrote: > LGTM. At first I thought this fix is not ...
10 years, 6 months ago (2013-10-31 05:29:05 UTC) #5
john2
10 years, 6 months ago (2013-10-31 05:29:22 UTC) #6
https://codereview.appspot.com/19000043/diff/1/worker/upgrader/upgrader.go
File worker/upgrader/upgrader.go (right):

https://codereview.appspot.com/19000043/diff/1/worker/upgrader/upgrader.go#ne...
worker/upgrader/upgrader.go:177: if _, err := agenttools.ReadTools(u.dataDir,
agentTools.Version); err == nil {
On 2013/10/30 18:03:30, rog wrote:
> This could probably be at the start of this function (the "fetching" log
message
> might be confusing when we're not actually fetching anything)

Done.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b