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

Issue 6317043: Add VersionWatcher type (for unitRelationWatcher)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 10 months ago by fwereade
Modified:
11 years, 10 months ago
Reviewers:
mp+111158, niemeyer, rog
Visibility:
Public.

Description

Add VersionWatcher type (for unitRelationWatcher) I am still concerned that we're doing a lot of unnecessary work for benefits I can't see. As succinctly as possible: * we are notified of a settings change. * we discard the actual data and retain only the version. * we thereby create potential state "changes" that aren't actual changes ( IIRC ConfigNode prevents non-changes from actually being written, but I don't really like implicitly depending on that sort of property of distant code). * when we come to execute hooks in response to that change, we look up that data again (which is now out of sequence wrt the relation membership). * we also cache that out-of-sequence data to prevent us from seeing more changes midway through hook execution (but the settings of individual nodes are cached individually at the time they're first accessed, so the relation membership, and the settings of every node accessed during hook execution, are all potentially out of sync). I accept that the out-of-sequence-ness doesn't really matter much -- and that after enough changes we'll always hit the same steady state -- but it seems to me that the above strategy is actually a lot more work, and harder to follow, than the following: * we are notified of a settings change * we store the settings * when running a hook in response to the change, we use the recorded settings I would greatly appreciate a succinct explanation of the benefits of the first approach over the second, because I still don't see what we (or the charm writers) gain in exchange for all the extra code and complexity; this would make me feel a lot more comfortable about the path down which this CL is the first step. https://code.launchpad.net/~fwereade/juju-core/version-watcher/+merge/111158 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : Add VersionWatcher type (for unitRelationWatcher) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+211 lines, -90 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M state/watcher/watcher.go View 3 chunks +163 lines, -90 lines 0 comments Download
M state/watcher/watcher_test.go View 1 chunk +46 lines, -0 lines 0 comments Download

Messages

Total messages: 5
fwereade
Please take a look.
11 years, 10 months ago (2012-06-20 07:28:21 UTC) #1
fwereade
Please take a look.
11 years, 10 months ago (2012-06-20 08:04:47 UTC) #2
rog
I'm not precisely clear on the issues that William is referring to, but I can't ...
11 years, 10 months ago (2012-06-20 09:44:52 UTC) #3
fwereade
On 2012/06/20 09:44:52, rog wrote: > I'm not precisely clear on the issues that William ...
11 years, 10 months ago (2012-06-20 11:13:32 UTC) #4
niemeyer
11 years, 10 months ago (2012-06-20 15:46:34 UTC) #5
Marking this as WIP until we find a moment to talk this through.
Sign in to reply to this message.

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