Merge lp:~mfoord/juju-core/write-majority into lp:~go-bot/juju-core/trunk

Proposed by Michael Foord
Status: Work in progress
Proposed branch: lp:~mfoord/juju-core/write-majority
Merge into: lp:~go-bot/juju-core/trunk
Diff against target: 14 lines (+4/-0)
1 file modified
state/open.go (+4/-0)
To merge this branch: bzr merge lp:~mfoord/juju-core/write-majority
Reviewer Review Type Date Requested Status
Juju Engineering Pending
Review via email: mp+220823@code.launchpad.net
To post a comment you must log in.
Revision history for this message
William Reade (fwereade) wrote :

Don't we also want `J: true` in there?

Revision history for this message
John A Meinel (jameinel) wrote :

AIUI we want both, yes.

Is there a way to test that we are setting this up at the appropriate time? (A simple test that said "are we connected to state with write majority set" )

Revision history for this message
Andrew Wilkins (axwalk) wrote :

Marking WIP pending further discussion.

Revision history for this message
Andrew Wilkins (axwalk) wrote :

Also, if we're already setting write majority then I think waiting for the jounral group commit is a win for little additional cost.

Revision history for this message
Andrew Wilkins (axwalk) wrote :

Although it really depends on how often we write. See: http://comments.gmane.org/gmane.comp.db.mongodb.user/52268

Revision history for this message
Michael Foord (mfoord) wrote :

Moved to github (although still WIP): https://github.com/voidspace/juju/compare/write-majority

Unmerged revisions

2747. By Michael Foord

Initial merge

2746. By Michael Foord

Merge

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'state/open.go'
2--- state/open.go 2014-05-19 20:36:21 +0000
3+++ state/open.go 2014-05-23 15:44:04 +0000
4@@ -93,6 +93,10 @@
5 }
6 logger.Debugf("connection established")
7
8+ // set mongo to write-majority (writes only returned after replicated to a
9+ // majority of replica-set members)
10+ session.SetSafe(&mgo.Safe{WMode: "majority"})
11+
12 st, err := newState(session, info, policy)
13 if err != nil {
14 session.Close()

Subscribers

People subscribed via source and target branches

to status/vote changes: