1+ .. _csharp-server-selection:
2+
13==========================
24Customize Server Selection
35==========================
@@ -24,7 +26,7 @@ customize this algorithm to choose the server that works best for your applicati
2426
2527.. important::
2628
27- Customizing the server- selection algorithm can have unintended consequences,
29+ Customizing the server selection algorithm might have unintended consequences,
2830 such as degraded read or write performance.
2931
3032Default Algorithm
@@ -33,46 +35,45 @@ Default Algorithm
3335When the {+driver-short+} executes a read operation, it performs the following steps,
3436in order, to select a MongoDB deployment:
3537
36- 1. From the list of known servers, the {+driver-short+} selects all servers
37- that match the active read preference.
38+ 1. Selects all servers that match the active read preference from the list of known servers.
3839
39- #. If at least one readable server exists, the {+ driver-short+} calls the user-defined
40+ #. If at least one readable server exists, the driver calls the user-defined
4041 server-selector function and passes in the list from the previous step.
4142
42- #. The {+driver-short+} applies the ``LocalThreshold`` connection setting to the list of
43+ #. Applies the ``LocalThreshold`` connection setting to the list of
4344 servers returned from the function.
4445
45- #. The {+driver-short+} selects a server at random from the servers still on the list and
46+ #. Selects a server at random from the servers still on the list and
4647 executes the operation against this server.
4748
4849When the {+driver-short+} executes a write operation, it begins by selecting all writeable
4950servers, not just those that match the active read preference. The remaining steps are
5051identical.
5152
52- To learn more about the default server- selection algorithm, which the driver follows
53- when you don't specify any custom server- selection logic, see
53+ To learn more about the default server selection algorithm, which the driver follows
54+ when you don't specify any custom server selection logic, see
5455:manual:`Server Selection Algorithm </core/read-preference-mechanics/>` in the
55- MongoDB Server manual.
56+ {+mdb-server+} manual.
5657
5758.. _csharp-server-selection-algorithm:
5859
5960Specifying Other Server Selection Algorithms
6061--------------------------------------------
6162
62- You can specify different server- selection logic by passing an instance of a server selector
63+ You can specify different server selection logic by passing an instance of a server selector
6364class to the ``PreServerSelector`` or ``PostServerSelector`` property of the ``ClusterConfigurator``. The
6465``PreServerSelector`` property specifies a server selector that runs before the
6566standard server selection logic runs, while the ``PostServerSelector`` property
6667specifies a server selector that runs after standard server selection logic runs. You can
6768then pass your ``ClusterConfigurator`` instance to the ``MongoClientSettings`` object when you create a
68- ``MongoClient`` instance to apply your custom server- selection logic.
69+ ``MongoClient`` instance to apply your custom server selection logic.
6970
7071The following table lists the different types of server selectors you can pass to the
7172``ClusterConfigurator`` property:
7273
7374.. list-table::
7475 :header-rows: 1
75- :widths: 30 70
76+ :widths: 40 60
7677
7778 * - Server Selector
7879 - Description
@@ -113,7 +114,7 @@ To learn more about the different server selector classes, see the
113114Implementing Custom Server Selection Logic
114115------------------------------------------
115116
116- You can also implement your own custom server- selection logic by creating a class that
117+ You can implement your own custom server selection logic by creating a class that
117118inherits from the ``IServerSelector`` interface and overrides the
118119``SelectServers()`` method. The following example shows a simple custom server
119120selection class that selects servers with a ``ServerType`` of
@@ -153,7 +154,7 @@ in your connection URI:
153154
154155 * - ``ReadPreference``
155156 - | The client's default read-preference settings. ``MaxStaleness`` represents the
156- | longest replication lag (in wall-clock time) that a secondary can experience and
157+ | longest replication lag (in real time) that a secondary can experience and
157158 | still be eligible for server selection. Specifying ``-1`` means no maximum.
158159 | See :ref:`read preference <read-preference>` for more information.
159160 |
0 commit comments