Skip to content

Commit 3403b50

Browse files
committed
fix links in sdam
1 parent 30ff78d commit 3403b50

File tree

4 files changed

+36
-33
lines changed

4 files changed

+36
-33
lines changed

source/extended-json.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ JSON format. If generators provide a default format, the default SHOULD be the R
275275

276276
A generator MAY be capable of exporting strings that adhere to other formats, such as Legacy Extended JSON formats.
277277

278-
A generator SHOULD support at least 100 \[levels of nesting\](#levels of nesting) in a BSON document.
278+
A generator SHOULD support at least 100 levels of nesting in a BSON document.
279279

280280
#### Transforming BSON
281281

source/server-discovery-and-monitoring/server-discovery-and-monitoring.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,13 @@ The server discovery and monitoring method is specified in four sections. First,
2424
[configured](#configuration). Second, it begins [monitoring](#monitoring) by calling
2525
[hello or legacy hello](../mongodb-handshake/handshake.rst#terms) on all servers. (Multi-threaded and asynchronous
2626
monitoring is described first, then single-threaded monitoring.) Third, as hello or legacy hello responses are received
27-
the client [parses them](#parsing-a-hello-or-legacy-hello-response), and fourth, it \[updates its view of the
28-
topology\](#updates its view of the topology).
27+
the client [parses them](#parsing-a-hello-or-legacy-hello-response), and fourth, it updates its view of the topology.
2928

30-
Finally, this spec describes how \[drivers update their topology view in response to errors\](#drivers update their
31-
topology view in response to errors), and includes generous implementation notes for driver authors.
29+
Finally, this spec describes how drivers update their topology view in response to errors, and includes generous
30+
implementation notes for driver authors.
3231

3332
This spec does not describe how a client chooses a server for an operation; that is the domain of the Server Selection
34-
Spec. But there is a section describing the \[interaction between monitoring and server selection\](#interaction between
35-
monitoring and server selection).
33+
Spec. But there is a section describing the interaction between monitoring and server selection.
3634

3735
There is no discussion of driver architecture and data structures, nor is there any specification of a user-facing API.
3836
This spec is only concerned with the algorithm for monitoring the server topology.
@@ -206,7 +204,7 @@ Fields:
206204
increase, as electionId takes precedence in ordering Default null. Part of the (`electionId`, `setVersion`) tuple.
207205
- servers: a set of ServerDescription instances. Default contains one server: "localhost:27017", ServerType Unknown.
208206
- stale: a boolean for single-threaded clients, whether the topology must be re-scanned. (Not related to
209-
maxStalenessSeconds, nor to \[stale primaries\](#stale primaries).)
207+
maxStalenessSeconds, nor to stale primaries.)
210208
- compatible: a boolean. False if any server's wire protocol version range is incompatible with the client's. Default
211209
true.
212210
- compatibilityError: a string. The error message if "compatible" is false, otherwise null.
@@ -234,13 +232,13 @@ Fields:
234232
least until
235233
[drivers allow applications to use readConcern "afterOptime".](../max-staleness/max-staleness.md#future-feature-to-support-readconcern-afteroptime))
236234
- (=) type: a [ServerType](#servertype) enum value. Default Unknown.
237-
- (=) minWireVersion, maxWireVersion: the wire protocol version range supported by the server. Both default to 0. \[Use
238-
min and maxWireVersion only to determine compatibility\](#use min and maxWireVersion only to determine compatibility).
235+
- (=) minWireVersion, maxWireVersion: the wire protocol version range supported by the server. Both default to 0.
236+
[Use min and maxWireVersion only to determine compatibility](#checking-wire-protocol-compatibility).
239237
- (=) me: The hostname or IP, and the port number, that this server was configured with in the replica set. Default
240238
null.
241239
- (=) hosts, passives, arbiters: Sets of addresses. This server's opinion of the replica set's members, if any. These
242-
[hostnames are normalized to lower-case](#hostnames-are-normalized-to-lower-case). Default empty. The client
243-
\[monitors all three types of servers\](#monitors all three types of servers) in a replica set.
240+
[hostnames are normalized to lower-case](#hostnames-are-normalized-to-lower-case). Default empty. The client monitors
241+
all three types of servers in a replica set.
244242
- (=) tags: map from string to string. Default empty.
245243
- (=) setName: string or null. Default null.
246244
- (=) electionId: an ObjectId, if this is a MongoDB 2.6+ replica set member that believes it is primary. See
@@ -575,6 +573,8 @@ Whenever the client checks a server (successfully or not), and regardless of whe
575573
to the previous server description as defined in [Server Description Equality](#server-description-equality), the
576574
ServerDescription in TopologyDescription.servers MUST be replaced with the new ServerDescription.
577575

576+
<span id="checking-wire-protocol-compatibility"></span>
577+
578578
##### Checking wire protocol compatibility
579579

580580
A ServerDescription which is not Unknown is incompatible if:
@@ -960,9 +960,9 @@ See error handling in the [Server Monitoring spec](server-monitoring.rst).
960960

961961
#### Application errors
962962

963-
When processing a network or command error, clients MUST first check the error's \[generation number\](#generation
964-
number). If the error's generation number is equal to the pool's generation number then error handling MUST continue
965-
according to [Network error when reading or writing](#network-error-when-reading-or-writing) or
963+
When processing a network or command error, clients MUST first check the error's generation number. If the error's
964+
generation number is equal to the pool's generation number then error handling MUST continue according to
965+
[Network error when reading or writing](#network-error-when-reading-or-writing) or
966966
["not writable primary" and "node is recovering"](#not-writable-primary-and-node-is-recovering). Otherwise, the error is
967967
considered stale and the client MUST NOT update any topology state. (See
968968
[Why ignore errors based on CMAP's generation number?](#why-ignore-errors-based-on-cmaps-generation-number))
@@ -1275,9 +1275,9 @@ Better to call hello or legacy hello for each new socket, as required by the [Au
12751275
hello or legacy hello response associated with that socket for maxWireVersion, maxBsonObjectSize, etc.: all the fields
12761276
required to correctly communicate with the server.
12771277

1278-
The hello or legacy hello responses received by monitors determine if the topology as a whole \[is compatible\](#is
1279-
compatible) with the driver, and which servers are suitable for selection. The monitors' responses should not be used to
1280-
determine how to format wire protocol messages to the servers.
1278+
The hello or legacy hello responses received by monitors determine if the topology as a whole is compatible with the
1279+
driver, and which servers are suitable for selection. The monitors' responses should not be used to determine how to
1280+
format wire protocol messages to the servers.
12811281

12821282
##### Immutable data
12831283

@@ -1667,8 +1667,8 @@ shard.
16671667

16681668
### Why ignore errors based on CMAP's generation number?
16691669

1670-
Using CMAP's \[generation number\](#generation number) solves the following race condition among application threads and
1671-
the monitor during error handling:
1670+
Using CMAP's generation number solves the following race condition among application threads and the monitor during
1671+
error handling:
16721672

16731673
1. Two concurrent writes begin on application threads A and B.
16741674
2. The server restarts.
@@ -1711,7 +1711,7 @@ after its check would happen after the pool was cleared and thus avoid putting i
17111711
### What is the purpose of topologyVersion?
17121712

17131713
[topologyVersion](#topologyversion) solves the following race condition among application threads and the monitor when
1714-
handling \[State Change Errors\](#State Change Errors):
1714+
handling State Change Errors:
17151715

17161716
1. Two concurrent writes begin on application threads A and B.
17171717
2. The primary steps down.

source/server-discovery-and-monitoring/server-monitoring.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -466,9 +466,9 @@ clients MUST cancel the hello or legacy hello check on that server and close the
466466

467467
### Polling Protocol
468468

469-
The polling protocol is used to monitor MongoDB \< 4.4 servers or when \[streaming is disabled\](#streaming is
470-
disabled). The client [checks](#check) a server with a hello or legacy hello command and then sleeps for
471-
heartbeatFrequencyMS before running another check.
469+
The polling protocol is used to monitor MongoDB \< 4.4 servers or when streaming is disabled. The client
470+
[checks](#check) a server with a hello or legacy hello command and then sleeps for heartbeatFrequencyMS before running
471+
another check.
472472

473473
### Marking the connection pool as ready (CMAP only)
474474

@@ -499,9 +499,8 @@ the client MUST follow these steps:
499499
[JAVA-1159](https://jira.mongodb.org/browse/JAVA-1159).)
500500
5. Otherwise, wait for heartbeatFrequencyMS (or minHeartbeatFrequencyMS if a check is requested) before restarting the
501501
monitoring protocol on a new connection.
502-
- Note that even in the streaming protocol, a monitor in this state will wait for an application operation to
503-
\[request an immediate check\](#request an immediate check) or for the heartbeatFrequencyMS timeout to expire
504-
before beginning the next check.
502+
- Note that even in the streaming protocol, a monitor in this state will wait for an application operation to request
503+
an immediate check or for the heartbeatFrequencyMS timeout to expire before beginning the next check.
505504

506505
See the pseudocode in the `Monitor thread` section.
507506

source/server-selection/server-selection.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,8 @@ The primary and all secondaries are candidates, but only eligible candidates are
331331
spec defines several other server types that could appear in a replica set. Such types are never candidates, eligible or
332332
suitable.
333333

334+
<span id="algorithm-for-filtering-by-staleness"></span>
335+
334336
##### maxStalenessSeconds
335337

336338
The maximum replication lag, in wall clock time, that a secondary can suffer and still be eligible.
@@ -393,6 +395,8 @@ After filtering servers according to `mode`, and before filtering with `tag_sets
393395

394396
See the Max Staleness Spec for overall description and justification of this feature.
395397

398+
<span id="algorithm-for-filtering-by-tag_sets"></span>
399+
396400
##### tag_sets
397401

398402
The read preference `tag_sets` parameter is an ordered list of tag sets used to restrict the eligibility of servers,
@@ -687,7 +691,7 @@ For multi-threaded clients, the server selection algorithm is as follows:
687691
["Server selection succeeded" message](#server-selection-succeeded-message). Do not go onto later steps.
688692
09. Request an immediate topology check, then block the server selection thread until the topology changes or until the
689693
server selection timeout has elapsed
690-
10. If server selection has timed out, raise a \[server selection error\](#server selection error) and log a
694+
10. If server selection has timed out, raise a [server selection error](#server-selection-errors) and log a
691695
["Server selection failed" message](#server-selection-failed-message).
692696
11. Goto Step #2
693697

@@ -711,7 +715,7 @@ Therefore, for single-threaded clients, the server selection algorithm is as fol
711715
04. If the topology is stale, proceed as follows:
712716
- record the target scan time as last scan time plus `minHeartBeatFrequencyMS`
713717
- if [serverSelectionTryOnce](#serverselectiontryonce) is false and the target scan time would exceed the maximum
714-
time, raise a \[server selection error(#server selection error) and log a
718+
time, raise a [server selection error](#server-selection-errors) and log a
715719
["Server selection failed" message](#server-selection-failed-message).
716720
- if the current time is less than the target scan time, sleep until the target scan time
717721
- do a blocking immediate topology check (which must also update the last scan time and mark the topology as no
@@ -728,11 +732,11 @@ Therefore, for single-threaded clients, the server selection algorithm is as fol
728732
["Server selection succeeded" message](#server-selection-succeeded-message).; otherwise, mark the topology stale and
729733
continue to step #9.
730734
09. If [serverSelectionTryOnce](#serverselectiontryonce) is true and the last scan time is newer than the selection
731-
start time, raise a \[server selection error\](#server selection error) and log a
735+
start time, raise a [server selection error](#server-selection-errors) and log a
732736
["Server selection failed" message](#server-selection-failed-message); otherwise, log a
733737
["Waiting for suitable server to become available" message](#waiting-for-suitable-server-to-become-available-message)
734738
if one has not already been logged for this operation, and goto Step #4
735-
10. If the current time exceeds the maximum time, raise a \[server selection error\](#server selection error) and log a
739+
10. If the current time exceeds the maximum time, raise a [server selection error](#server-selection-errors) and log a
736740
["Server selection failed" message](#server-selection-failed-message).
737741
11. Goto Step #4
738742

@@ -801,8 +805,8 @@ If `mode` is 'secondary' or 'nearest':
801805
> 3. From the remaining servers, select servers matching the `tag_sets`.
802806
> 4. From these, select one server within the latency window.
803807
804-
(See \[algorithm for filtering by staleness\](#algorithm for filtering by staleness), \[algorithm for filtering by
805-
tag_sets\](#algorithm for filtering by tag_sets), and
808+
(See [algorithm for filtering by staleness](#algorithm-for-filtering-by-staleness),
809+
[algorithm for filtering by tag_sets](#algorithm-for-filtering-by-tag_sets), and
806810
[filtering suitable servers based on the latency window](#filtering-suitable-servers-based-on-the-latency-window) for
807811
details on each step, and
808812
[why is maxStalenessSeconds applied before tag_sets?](#why-is-maxstalenessseconds-applied-before-tag_sets).)

0 commit comments

Comments
 (0)