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

Delta Between Two Patch Sets: replicaset/replicaset.go

Issue 104800043: replicaset/initiate: wait for status from initiate
Left Patch Set: replicaset/initiate: wait for status from initiate Created 10 years, 10 months ago
Right Patch Set: replicaset/initiate: wait for status from initiate Created 10 years, 10 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « [revision details] ('k') | replicaset/replicaset_test.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 package replicaset 1 package replicaset
2 2
3 import ( 3 import (
4 "fmt" 4 "fmt"
5 "io" 5 "io"
6 "strings" 6 "strings"
7 "time" 7 "time"
8 8
9 "github.com/juju/loggo" 9 "github.com/juju/loggo"
10 "labix.org/v2/mgo" 10 "labix.org/v2/mgo"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 continue 68 continue
69 } 69 }
70 break 70 break
71 } 71 }
72 72
73 for i := 0; i < maxInitiateStatusAttempts; i++ { 73 for i := 0; i < maxInitiateStatusAttempts; i++ {
74 status, err := getCurrentStatus(monotonicSession) 74 status, err := getCurrentStatus(monotonicSession)
75 if err != nil { 75 if err != nil {
76 logger.Warningf("Initiate: fetching replicaset status fa iled: %v", err) 76 logger.Warningf("Initiate: fetching replicaset status fa iled: %v", err)
77 } 77 }
78 » » if err != nil || (len(status.Members) == 0) { 78 » » if err != nil || len(status.Members) == 0 {
79 time.Sleep(initiateAttemptDelay) 79 time.Sleep(initiateAttemptDelay)
80 continue 80 continue
81 } 81 }
82 break 82 break
83 } 83 }
84 return err 84 return err
85 } 85 }
86 86
87 // Member holds configuration information for a replica set member. 87 // Member holds configuration information for a replica set member.
88 // 88 //
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 ShunnedState: "SHUNNED", 422 ShunnedState: "SHUNNED",
423 } 423 }
424 424
425 // String returns a string describing the state. 425 // String returns a string describing the state.
426 func (state MemberState) String() string { 426 func (state MemberState) String() string {
427 if state < 0 || int(state) >= len(memberStateStrings) { 427 if state < 0 || int(state) >= len(memberStateStrings) {
428 return "INVALID_MEMBER_STATE" 428 return "INVALID_MEMBER_STATE"
429 } 429 }
430 return memberStateStrings[state] 430 return memberStateStrings[state]
431 } 431 }
LEFTRIGHT

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