Skip to content

Conversation

@sanych-sun
Copy link
Member

No description provided.

@sanych-sun sanych-sun requested a review from a team as a code owner January 23, 2026 00:23
@sanych-sun sanych-sun requested review from Copilot and rstam January 23, 2026 00:23
@sanych-sun sanych-sun added the feature Adds new user-facing functionality. label Jan 23, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR extends server selection's deprioritized servers feature from Sharded clusters to all topology types (Single, ReplicaSet, LoadBalanced). The changes replace the legacy PriorityServerSelector with a new DeprioritizedServersServerSelector that wraps any server selector and filters out deprioritized servers, falling back to including them if no other servers are available.

Changes:

  • Introduced DeprioritizedServersServerSelector to replace PriorityServerSelector with a wrapper pattern
  • Deprecated PriorityServerSelector for future removal
  • Added comprehensive test specifications covering deprioritized servers across all topology types

Reviewed changes

Copilot reviewed 132 out of 132 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/MongoDB.Driver/Core/Clusters/ServerSelectors/DeprioritizedServersServerSelector.cs New selector implementing the wrapper pattern for deprioritized servers
src/MongoDB.Driver/Core/Clusters/ServerSelectors/PriorityServerSelector.cs Marked as obsolete with deprecation notice
src/MongoDB.Driver/Core/Clusters/IClusterExtensions.cs Updated to use new DeprioritizedServersServerSelector instead of composite pattern
src/MongoDB.Driver/Core/Bindings/WritableServerBinding.cs Updated to use new DeprioritizedServersServerSelector instead of composite pattern
tests/MongoDB.Driver.Tests/Core/Clusters/ServerSelectors/DeprioritizedServersServerSelectorTests.cs New comprehensive test suite for the selector
tests/MongoDB.Driver.Tests/Core/Clusters/ServerSelectors/PriorityServerSelectorTests.cs Removed obsolete tests
tests/MongoDB.Driver.Tests/Core/Clusters/ClusterTests.cs Removed sharded-only tests for deprioritized servers
tests/MongoDB.Driver.Tests/Specifications/server-selection/ServerSelectionTestRunner.cs Added support for deprioritized_servers field in test definitions
specifications/server-selection/tests/server_selection//Deprioritized.{yml,json} New test specifications for deprioritized servers across all topologies
specifications/server-selection/tests/server_selection//.{yml,json} Formatting updates to existing test files
specifications/server-selection/tests/README.rst Removed obsolete documentation file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sanych-sun sanych-sun requested review from papafe and removed request for rstam January 23, 2026 00:24
Copy link
Contributor

@papafe papafe left a comment

Choose a reason for hiding this comment

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

LGTM

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

Labels

feature Adds new user-facing functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants