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

Issue 13494043: state;uniter: Refactor UnitSettings and hook.Info (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 8 months ago by dimitern
Modified:
10 years, 7 months ago
Reviewers:
jameinel, fwereade, mp+183700
Visibility:
Public.

Description

state;uniter: Refactor UnitSettings and hook.Info This removes the Settings field from state.UnitSettings, and the Members field from uniter/hook.Info structs. The first one is never guaranteed to be non-nil and is marked for removal some time ago, but the actual removing is a bit involved. The second one is only kept in-memory as a cache by the hookqueue and never serialized to disk. It's reconstructed at uniter startup from the local disk cache and relation info. These changes are needed in order to simplify the API implementation of RelationUnitsWatcher, and also to avoid pushing unnecessary data over the wire. https://code.launchpad.net/~dimitern/juju-core/118-state-remove-unitsettings-from-relationunitschange/+merge/183700 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+48 lines, -149 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M state/relationunit_test.go View 1 chunk +0 lines, -3 lines 1 comment Download
M state/unit.go View 1 chunk +1 line, -4 lines 0 comments Download
M state/watcher.go View 1 chunk +1 line, -1 line 0 comments Download
M worker/uniter/context.go View 1 chunk +4 lines, -8 lines 1 comment Download
M worker/uniter/context_test.go View 1 chunk +3 lines, -4 lines 1 comment Download
M worker/uniter/hook/hook.go View 1 chunk +0 lines, -6 lines 0 comments Download
M worker/uniter/relation/hookqueue.go View 3 chunks +1 line, -15 lines 0 comments Download
M worker/uniter/relation/hookqueue_test.go View 11 chunks +36 lines, -59 lines 0 comments Download
M worker/uniter/relationer.go View 1 chunk +0 lines, -1 line 0 comments Download
M worker/uniter/relationer_test.go View 8 chunks +0 lines, -34 lines 0 comments Download
M worker/uniter/state.go View 1 chunk +0 lines, -7 lines 0 comments Download
M worker/uniter/state_test.go View 2 chunks +0 lines, -7 lines 0 comments Download

Messages

Total messages: 4
dimitern
Please take a look.
10 years, 8 months ago (2013-09-03 15:45:53 UTC) #1
jameinel
A very nice ratio of deleted lines to added lines. LGTM
10 years, 7 months ago (2013-09-04 06:57:27 UTC) #2
dimitern
After live testing as recommended by William: 1. Bootstrap a local environment 2. Deploy a ...
10 years, 7 months ago (2013-09-04 09:20:42 UTC) #3
fwereade
10 years, 7 months ago (2013-09-04 11:36:15 UTC) #4
Message was sent while issue was closed.
The critical bit the live testing may have missed was checking that caches were
cleared for changed members.

So something like:

  skip u/0 joined and changed
  skip v/0 joined
  in v/0 changed, set value=0
  in u/0 changed, get value, check == 0; set blah=0
  in v/0 changed, set value=1
  in u/0 changed, get value, check == 1

But assuming that works, LGTM, this is lovely. Thanks!

https://codereview.appspot.com/13494043/diff/1/state/relationunit_test.go
File state/relationunit_test.go (left):

https://codereview.appspot.com/13494043/diff/1/state/relationunit_test.go#old...
state/relationunit_test.go:1219: c.Assert(ch.Changed[name].Settings,
gc.DeepEquals, m)
We still need to check versions, don't we?

https://codereview.appspot.com/13494043/diff/1/worker/uniter/context.go
File worker/uniter/context.go (right):

https://codereview.appspot.com/13494043/diff/1/worker/uniter/context.go#newco...
worker/uniter/context.go:305: // overwritten.
 with the supplied values?

https://codereview.appspot.com/13494043/diff/1/worker/uniter/context_test.go
File worker/uniter/context_test.go (right):

https://codereview.appspot.com/13494043/diff/1/worker/uniter/context_test.go#...
worker/uniter/context_test.go:374: // Check that all settings remain cached.
Shouldn't we keep the behaviour above and check that u/2's cache is cleared?
Sign in to reply to this message.

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