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

Issue 11407044: Use isMaster.localTime instead of eval (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 9 months ago by sidnei.da.silva
Modified:
10 years, 9 months ago
Reviewers:
dimitern, thumper, mp+175653
Visibility:
Public.

Description

Use isMaster.localTime instead of eval In mongo 2.4.x (default in saucy), eval requires admin privileges. Replace by isMaster which does not require admin privileges (but requires mongo 2.2 at minimum). Thanks to Gustavo for the help in implementing the fix. https://code.launchpad.net/~sidnei/juju-core/mongo-2.4-compat/+merge/175653 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 1

Patch Set 2 : Use isMaster.localTime instead of eval #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+54 lines, -8 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M state/presence/presence.go View 1 1 chunk +52 lines, -8 lines 1 comment Download

Messages

Total messages: 6
sidnei.da.silva
Please take a look.
10 years, 9 months ago (2013-07-18 19:15:00 UTC) #1
thumper
https://codereview.appspot.com/11407044/diff/1/state/presence/presence.go File state/presence/presence.go (right): https://codereview.appspot.com/11407044/diff/1/state/presence/presence.go#newcode618 state/presence/presence.go:618: err := c.Database.Run("isMaster", &isMaster) I think the command to ...
10 years, 9 months ago (2013-07-18 22:08:26 UTC) #2
sidnei.da.silva
Please take a look.
10 years, 9 months ago (2013-07-18 22:32:08 UTC) #3
thumper
LGTM
10 years, 9 months ago (2013-07-18 23:33:51 UTC) #4
dimitern
LGTM with a minor suggestion. https://codereview.appspot.com/11407044/diff/6001/state/presence/presence.go File state/presence/presence.go (right): https://codereview.appspot.com/11407044/diff/6001/state/presence/presence.go#newcode671 state/presence/presence.go:671: return serverDelay, nil maybe ...
10 years, 9 months ago (2013-07-19 05:42:29 UTC) #5
dimitern
10 years, 9 months ago (2013-07-19 05:42:29 UTC) #6
LGTM with a minor suggestion.

https://codereview.appspot.com/11407044/diff/6001/state/presence/presence.go
File state/presence/presence.go (right):

https://codereview.appspot.com/11407044/diff/6001/state/presence/presence.go#...
state/presence/presence.go:671: return serverDelay, nil
maybe put a:

if !supportsMasterLocalTime {
    log.Warningf("state/presence: mongodb 2.2 or earlier detected, using eval
for timestamps")
}

or something similar?
Sign in to reply to this message.

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