Skip to content

RUST-2179 Ignore whether nodes are data-bearing when directConnection is true #1334

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

Merged
merged 1 commit into from
Mar 18, 2025

Conversation

isabelatkinson
Copy link
Contributor

RUST-2179, fixes #1332

.filter(|s| {
// If we're direct-connected or connected to a standalone, ignore whether the
// single server in the topology is data-bearing.
(self.topology_type == TopologyType::Single || s.server_type.is_data_bearing())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The GetMore operation sets its selection criteria to a predicate, which meant that a direct connection to a hidden replica set member (which the driver gives server type RsOther) couldn't be selected here because it's not considered data-bearing. The fix here is to ignore whether a server is data-bearing if it's the only one in the topology. I didn't have much spec guidance to go off of here because, as far as I can tell, the predicate selection criteria variant is a rust-driver-specific thing. However, this server selection spec section indicates that the lone server in a single topology should always be selected.

It does still seem reasonable to filter out non-data-bearing servers when there are multiple servers in a topology so that, e.g., an arbiter isn't selected when a primary or secondary is also available.

@isabelatkinson isabelatkinson marked this pull request as ready for review March 17, 2025 23:11
@isabelatkinson isabelatkinson requested a review from abr-egn March 17, 2025 23:11
@isabelatkinson isabelatkinson merged commit ace6f89 into mongodb:main Mar 18, 2025
14 of 17 checks passed
isabelatkinson added a commit that referenced this pull request Mar 19, 2025
* RUST-2179 Ignore whether nodes are data-bearing when directConnection is true (#1334)

* RUST-2180 Update version numbers for 3.2.3 (#1337)
@isabelatkinson isabelatkinson deleted the hidden-get-more branch May 9, 2025 19:12
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.

Cursor deadlock when connected to a hidden replica with directConnection=true
2 participants