-
Notifications
You must be signed in to change notification settings - Fork 912
Readpref #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Readpref #10
Conversation
3923ceb
to
955e950
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice and clean. It wouldn't be too much more work to implement the server selection tests in the server selection and max staleness specs, and that would give more confidence that the algorithm is correct. I'd like to see that before this is pushed.
core/readpref/selector.go
Outdated
|
||
switch cluster.Type { | ||
case desc.Single: | ||
return servers, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can servers contain any of type Unknown? If so it needs to be filtered out here.
core/readpref/selector.go
Outdated
return selectByType(servers, desc.Mongos), nil | ||
} | ||
|
||
return nil, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return an error for unsupported cluster type
core/readpref/selector.go
Outdated
return nil | ||
} | ||
|
||
fmt.Printf("HERE") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove debugging code
core/readpref/readpref.go
Outdated
// New constructs a read preference from the mode and optionally | ||
// some name value pairs. | ||
func New(mode Mode, tagSets ...desc.TagSet) *ReadPref { | ||
// TODO: think about having an error for invalid construction |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reminding me of Namespace. Let's just make sure we're consistent where it makes sense, both for error checking and for private/public fields.
db37f9a
to
74153f4
Compare
74153f4
to
3ad6b97
Compare
removing and will put up a new one when it's ready. |
* GODRIVER-2277 Remove causal consistency prose test #10 * GODRIVER-2277 Remove causal consistency prose test no. 10 * add unack writes subtest to TestSessions * couple assertion and msg * use non-verbose error handling * allow error reassignment * make assert msg more verbose * clean up assert msg
Added readpref package and tests.