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

Issue 12909044: Don't forward logs if deploying on state server (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 8 months ago by axw
Modified:
10 years, 8 months ago
Reviewers:
jameinel, axw1, natefinch, wallyworld, mp+180057
Visibility:
Public.

Description

Don't forward logs if deploying on state server Previously, whenever a unit was deployed a configuration file was created in /etc/rsyslog.d to forward logs to the state servers. This introduced a feedback loop when the the unit was deployed on a state server machine. Now, check for the existence of /etc/rsyslog.d/25-juju.conf before creating an additional configuration. Fixes bug #1211147 https://code.launchpad.net/~axwalk/juju-core/lp1211147-no-log-forwarding-on-state/+merge/180057 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+58 lines, -30 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M worker/deployer/simple.go View 2 chunks +32 lines, -20 lines 5 comments Download
M worker/deployer/simple_test.go View 5 chunks +24 lines, -10 lines 0 comments Download

Messages

Total messages: 5
axw
Please take a look.
10 years, 8 months ago (2013-08-14 07:59:09 UTC) #1
jameinel
I'd like Ian to look over this change, as he's the one that set up ...
10 years, 8 months ago (2013-08-14 10:45:13 UTC) #2
natefinch
John's point about finding a better way to determine if this machine is forwarding to ...
10 years, 8 months ago (2013-08-14 19:23:58 UTC) #3
wallyworld
not lgtm because there is a better way to determine if the machine is a ...
10 years, 8 months ago (2013-08-15 01:14:01 UTC) #4
axw1
10 years, 8 months ago (2013-08-15 01:29:48 UTC) #5
Thanks for the reviews all. I'll create two new MPs: one that introduces
IsStateServer to state.Machine, and one that uses it in the deployer code.

https://codereview.appspot.com/12909044/diff/1/worker/deployer/simple.go
File worker/deployer/simple.go (right):

https://codereview.appspot.com/12909044/diff/1/worker/deployer/simple.go#newc...
worker/deployer/simple.go:135: if _, statErr :=
os.Stat(syslogConfigRenderer.ConfigFilePath()); os.IsNotExist(statErr) {
On 2013/08/14 10:45:13, jameinel wrote:
> Is it possible to detect that our local IP Address is in 'stateAddrs' instead
of
> statting for the file?

Fair enough. I did feel a little queasy when I implemented it in terms of file
presence; that should've been my cue to stop ;)

I did consider checking the local IPs, but didn't think it much better. I don't
know if we'd ever do it, but what about state servers behind NAT? Then you're
screwed.

https://codereview.appspot.com/12909044/diff/1/worker/deployer/simple.go#newc...
worker/deployer/simple.go:135: if _, statErr :=
os.Stat(syslogConfigRenderer.ConfigFilePath()); os.IsNotExist(statErr) {
On 2013/08/15 01:14:02, wallyworld wrote:
> We can detect if a machine is a state server by querying its Jobs and seeing
if
> it has the JobManageState job. I would introduce a new method on machine
> IsStateServer() and use that here rather than check for a (fragile) file name.
> When we move to HA, the new method would also likely be generally applicable
for
> other things as well.

This sounds good to me. I would've done this originally, but there's no state
objects passed through to the deployer. It sounds like there's no good reason
for there not to be, though, so I'll modify NewSimpleContext to take a
*state.Machine and do what you've suggested.
Sign in to reply to this message.

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