This repository has been archived by the owner on Jan 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rip out internal connection pooling.
We do not need to guarantee thread affinity so the complexity of the internal connection pool and reaper is no longer needed. We simply now just use the connection_pool gem.
- Loading branch information
Showing
11 changed files
with
40 additions
and
830 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
307cb8f
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.
😿
307cb8f
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.
How you do this isn't a hard requirement, but the spec for all drivers does require that you can read your own writes for the same thread of execution even when using an unacknowledged write-concern level.
Last I checked, the connection_pool gem doesn't guarantee this. Has something changed?
307cb8f
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.
The ruby driver uses thread affinity to ensure the ability read-your-own-writes and while I'm not 100% against this approach, its also been the source of many nasty bugs for us. I'm not sure we'll take the same approach in our 2.0 driver.
The Python driver "solved" (I feel like they cheated a bit since its not default pooling behavior) by adding a
client.start_request()
method that you explicitly call before performing a given set of operations where you know you need this behavior.http://emptysqua.re/blog/read-your-writes-consistency-pymongo/
In any case though, I don't think the connection_pool gem alone will satisfy all the requirements you need. This isn't generally an issue if you're using at least w=1 but its still a requirement to provide the ability to read back writes for w=0.
This may also be an issue for you:
307cb8f
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.
I agree with brandonblack and there are more use cases for thread affinity connections as well. See #245 as well for TokuMX support though I know that will be a much smaller audience.