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

Issue 12443044: apiserver: StatusSetter common mixin (Closed)

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

Description

apiserver: StatusSetter common mixin Extracted SetStatus handling from Machiner and created a StatusSetter mixin in apiserver/common, using the same model as for Remover and PasswordChanger. Also refactored the Machiner facade to use it. As a drive-by fix changed several test packages to import gocheck aliased as "gc". This is the first of several steps to extract common API code from the machiner, so it can be used by the upcoming Uniter facade. https://code.launchpad.net/~dimitern/juju-core/088-api-statussetter/+merge/178529 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 7

Patch Set 2 : apiserver: StatusSetter common mixin #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+470 lines, -252 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M state/api/machiner/machine.go View 1 chunk +2 lines, -2 lines 0 comments Download
M state/api/params/internal.go View 1 2 chunks +17 lines, -0 lines 0 comments Download
M state/apiserver/common/life_test.go View 1 4 chunks +38 lines, -38 lines 0 comments Download
M state/apiserver/common/password_test.go View 1 5 chunks +59 lines, -59 lines 0 comments Download
M state/apiserver/common/remove.go View 1 chunk +3 lines, -2 lines 0 comments Download
M state/apiserver/common/remove_test.go View 1 4 chunks +48 lines, -48 lines 0 comments Download
M state/apiserver/common/resource_test.go View 4 chunks +25 lines, -23 lines 0 comments Download
A state/apiserver/common/setstatus.go View 1 1 chunk +69 lines, -0 lines 1 comment Download
A state/apiserver/common/setstatus_test.go View 1 1 chunk +131 lines, -0 lines 0 comments Download
M state/apiserver/machine/common_test.go View 2 chunks +4 lines, -4 lines 0 comments Download
M state/apiserver/machine/machiner.go View 2 chunks +7 lines, -30 lines 0 comments Download
M state/apiserver/machine/machiner_test.go View 10 chunks +46 lines, -46 lines 0 comments Download
M state/state.go View 2 chunks +19 lines, -0 lines 0 comments Download

Messages

Total messages: 5
dimitern
Please take a look.
10 years, 9 months ago (2013-08-05 10:33:49 UTC) #1
rog
LGTM with backward compatibility preserved (and please explicitly check that you can upgrade from 1.12 ...
10 years, 9 months ago (2013-08-05 11:25:25 UTC) #2
gz
LGTM. I don't fully comprehend the upgrade/deprecation story for the api, but trust the comments ...
10 years, 9 months ago (2013-08-05 13:15:53 UTC) #3
dimitern
Please take a look. https://codereview.appspot.com/12443044/diff/1/state/api/params/internal.go File state/api/params/internal.go (right): https://codereview.appspot.com/12443044/diff/1/state/api/params/internal.go#newcode67 state/api/params/internal.go:67: Entities []SetEntityStatus On 2013/08/05 11:25:26, ...
10 years, 9 months ago (2013-08-05 13:25:44 UTC) #4
jameinel
10 years, 9 months ago (2013-08-08 17:45:01 UTC) #5
Message was sent while issue was closed.
Changing an API has 2 compatibility directions. New clients will make a call on
an old server, and old clients will place a call on a New server.

Generally, the easiest way is to create a new API so that old clients call the
old API on the new server, and when new clients call the new api they notice it
is missing, and fall back to the old api.

I don't know if SetStatus failing is fatal to the Machine agent, but I think it
might be.

I think this is a good point at which we want to raise the discussion about how
much effort we want to put into maintaining API compatibility, and what is sane
to do.

https://codereview.appspot.com/12443044/diff/9001/state/apiserver/common/sets...
File state/apiserver/common/setstatus.go (right):

https://codereview.appspot.com/12443044/diff/9001/state/apiserver/common/sets...
state/apiserver/common/setstatus.go:48: if len(args.Entities) == 0 {
Can we add a log message here to indicate that the deprecated functionality is
being called?

This might also help in the upgrade case.

There is also a slight concern that clients will upgrade to 1.14 before the core
server will upgrade to 1.14. (In my testing of upgrade, clients always upgraded
before machine-0 because of how the graceful shutdown and restart worked).

If the result is just that the machine agents restart a couple times while
waiting for machine-0 to restart, that is probably ok. As long as they don't get
into a "restart indefinitely on a condition that will never resolve".
Sign in to reply to this message.

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