Skip to content

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

Closed
wants to merge 1 commit into from
Closed

Readpref #10

wants to merge 1 commit into from

Conversation

craiggwilson
Copy link
Collaborator

Added readpref package and tests.

  • Also added a makefile so I don't forget to run all the tests. I'm using nmake on windows, which is slightly different. I left it dead simple so it should work with gnu make as well.
  • A little renaming in the desc/core packages.

Copy link
Contributor

@jyemin jyemin left a 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.


switch cluster.Type {
case desc.Single:
return servers, nil
Copy link
Contributor

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.

return selectByType(servers, desc.Mongos), nil
}

return nil, nil
Copy link
Contributor

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

return nil
}

fmt.Printf("HERE")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove debugging code

// 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
Copy link
Contributor

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.

@craiggwilson craiggwilson force-pushed the readpref branch 2 times, most recently from db37f9a to 74153f4 Compare February 13, 2017 18:35
@craiggwilson
Copy link
Collaborator Author

removing and will put up a new one when it's ready.

prestonvasquez added a commit that referenced this pull request Mar 22, 2022
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants