Merge lp://staging/~mfoord/juju-core/slow-replset into lp://staging/~go-bot/juju-core/trunk
Proposed by
Michael Foord
Status: | Merged |
---|---|
Approved by: | Michael Foord |
Approved revision: | no longer in the source branch. |
Merged at revision: | 2819 |
Proposed branch: | lp://staging/~mfoord/juju-core/slow-replset |
Merge into: | lp://staging/~go-bot/juju-core/trunk |
Diff against target: |
81 lines (+46/-0) 2 files modified
replicaset/replicaset.go (+17/-0) replicaset/replicaset_test.go (+29/-0) |
To merge this branch: | bzr merge lp://staging/~mfoord/juju-core/slow-replset |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+221709@code.staging.launchpad.net |
Commit message
replicaset/
After replicaset initiation wait (briefly) for a
status check to return successfully. Hopefully this
will fix the problems with bootstrap on precise for
slow machines. It also means we won't attempt to
use the database until we know the replicaset is
ready.
Description of the change
replicaset/
After replicaset initiation wait (briefly) for a
status check to return successfully. Hopefully this
will fix the problems with bootstrap on precise for
slow machines. It also means we won't attempt to
use the database until we know the replicaset is
ready.
To post a comment you must log in.
Reviewers: mp+221709_ code.launchpad. net,
Message:
Please take a look.
Description: initiate: wait for config from initiate
replicaset/
After replica set initiation wait (briefly) for a
config check to return successfully. Hopefully this
will fix the problems with bootstrap on precise for
slow machines.
https:/ /code.launchpad .net/~mfoord/ juju-core/ slow-replset/ +merge/ 221709
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/104800043/
Affected files (+19, -0 lines): replicaset. go
A [revision details]
M replicaset/
Index: [revision details] 20140602083040- w9o6gm2nvydmo7u 1
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: tarmac-
+New revision: <email address hidden>
Index: replicaset/ replicaset. go replicaset. go' replicaset. go 2014-05-30 00:31:44 +0000 replicaset. go 2014-06-02 11:18:12 +0000 mptDelay = 100 * time.Millisecond
=== modified file 'replicaset/
--- replicaset/
+++ replicaset/
@@ -23,6 +23,10 @@
// attempts to replSetInitiate.
initiateAtte
+ // initiateConfigDelay is the amount of time to sleep between failed hableError is the error message returned from mongo mpts; i++ { monotonicSessio n) Warningf( "Initiate: fetching config failed: %v", err) initiateConfigD elay)
+ // attempts to get the replicaset config after initiate
+ initiateConfigDelay = 500 * time.Millisecond
+
// rsMembersUnreac
// when it thinks that replicaset members are unreachable. This can
// occur if replSetInitiate is executed shortly after starting up mongo.
@@ -64,6 +68,19 @@
}
break
}
+
+ var config *Config
+ for i := 0; i < maxInitiateAtte
+ config, err = CurrentConfig(
+ if err != nil {
+ logger.
+ }
+ if err != nil || len(config.Members) == 0 {
+ time.Sleep(
+ continue
+ }
+ break
+ }
return err
}