Skip to content
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

(POC) Pin cursors to connections #70

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

prestonvasquez
Copy link

@prestonvasquez prestonvasquez commented Apr 9, 2024

The current implementation of MongoBetween uses a cursor caching solution with N >= 1 Mongos (LB7), so cursors being pinned to servers is acceptable. However, when load-balancing at the TCP layer it is not possible to target the same Mongos behind a load balancer when pooling connections (which is done under the hood in the Go Driver). This PR proposes pinning cursors and transactions to connections to account for this.

@@ -116,3 +121,107 @@ func TestRoundTripProcessError(t *testing.T) {

assert.Equal(t, description.ServerKind(description.Unknown), m.Description().Servers[0].Kind, "Failed to update the server Kind to Unknown")
}

func TestMongo_RoundTrip_Cursor(t *testing.T) {
const uri = "mongodb://127.0.0.1:8001/?loadBalanced=true"
Copy link
Author

Choose a reason for hiding this comment

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

This will have to be changed to reflect local and CI requirements for MongoBetween development

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant