Skip to content

Commit 77f9f66

Browse files
DRIVERS-1673 Minor typo fixes (#1338)
Co-authored-by: Kaitlin Mahar <kaitlinmahar@gmail.com> Co-authored-by: Kaitlin Mahar <kaitlinmahar@gmail.com> Co-authored-by: Kaitlin Mahar <kaitlinmahar@gmail.com> Co-authored-by: Kaitlin Mahar <kaitlinmahar@gmail.com> Co-authored-by: Kaitlin Mahar <kaitlinmahar@gmail.com> Co-authored-by: Kaitlin Mahar <kaitlinmahar@gmail.com> Co-authored-by: Kaitlin Mahar <kaitlinmahar@gmail.com> Co-authored-by: Kaitlin Mahar <kaitlinmahar@gmail.com>
1 parent f89fa9f commit 77f9f66

File tree

7 files changed

+62
-55
lines changed

7 files changed

+62
-55
lines changed

source/client-side-encryption/tests/README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -610,15 +610,15 @@ Using ``client_encrypted`` perform the following operations:
610610

611611
- ``{ "_id": "over_2mib_2", "unencrypted": <the string "a" repeated (2097152) times> }``
612612

613-
Expect the bulk write to succeed and split after first doc (i.e. two inserts occur). This may be verified using `command monitoring <https://github.com/mongodb/specifications/tree/master/source/command-monitoring/command-monitoring.rst>`_.
613+
Expect the bulk write to succeed and split after first doc (i.e. two inserts occur). This may be verified using `command monitoring <https://github.com/mongodb/specifications/tree/master/source/command-logging-and-monitoring/command-logging-and-monitoring.rst>`_.
614614

615615
#. Bulk insert the following:
616616

617617
- The document `limits/limits-doc.json <../limits/limits-doc.json>`_ concatenated with ``{ "_id": "encryption_exceeds_2mib_1", "unencrypted": < the string "a" repeated (2097152 - 2000) times > }``
618618

619619
- The document `limits/limits-doc.json <../limits/limits-doc.json>`_ concatenated with ``{ "_id": "encryption_exceeds_2mib_2", "unencrypted": < the string "a" repeated (2097152 - 2000) times > }``
620620

621-
Expect the bulk write to succeed and split after first doc (i.e. two inserts occur). This may be verified using `command monitoring <https://github.com/mongodb/specifications/tree/master/source/command-monitoring/command-monitoring.rst>`_.
621+
Expect the bulk write to succeed and split after first doc (i.e. two inserts occur). This may be verified using `command logging and monitoring <https://github.com/mongodb/specifications/tree/master/source/command-logging-and-monitoring/command-logging-and-monitoring.rst>`_.
622622

623623
#. Insert ``{ "_id": "under_16mib", "unencrypted": <the string "a" repeated 16777216 - 2000 times>``.
624624

source/crud/tests/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ like so:
269269
}
270270
}
271271
272-
Enable `command monitoring <../../command-monitoring/command-monitoring.rst>`_
272+
Enable `command monitoring <../../command-logging-and-monitoring/command-logging-and-monitoring.rst>`_
273273
to observe CommandSucceededEvents. Then, insert an invalid document (e.g.
274274
``{x: 1}``) and assert that a WriteError occurs, that its code is ``121``
275275
(i.e. DocumentValidationFailure), and that its ``details`` property is

source/logging/logging.rst

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Logging
1212

1313
Abstract
1414
========
15-
This specification defines requirements for drivers' logging configuration and behavior.
15+
This specification defines requirements for drivers' logging configuration and behavior.
1616

1717

1818
META
@@ -51,7 +51,7 @@ not require any changes to an application's source code, and in the case of comp
5151
does not require recompilation.
5252
However, if that is impossible to do without conflicting with idiomatic logging patterns for the
5353
language ecosystem, it is acceptable for a driver to require minimal changes to enable logging,
54-
such as recompiling with a feature flag specified, or passing a logging configuration to a
54+
such as recompiling with a feature flag specified, or passing a logging configuration to a
5555
``MongoClient`` constructor. In that case, drivers SHOULD strive to minimize the amount of code
5656
change needed.
5757

@@ -75,8 +75,8 @@ Per-Component Configuration of Log Levels
7575
-----------------------------------------
7676
Drivers MUST support enabling logging and specifying the minimum severity level for emitted messages
7777
on a per-component level, for each component defined below in the `Components`_ section.
78-
79-
**Fallback implementation method**: Support configuration via environment variables
78+
79+
**Fallback implementation method**: Support configuration via environment variables
8080
corresponding to each component, as defined in `Components`_, as well as via the
8181
environment variable ``MONGODB_LOG_ALL``.
8282

@@ -89,7 +89,7 @@ on a per-component level, for each component defined below in the `Components`_
8989
If ``MONGODB_LOG_ALL`` is specified in addition to one or more component variables, the
9090
component variable(s) MUST take precedence.
9191

92-
The default is to not log anything.
92+
The default is to not log anything.
9393

9494
If a variable is set to an invalid value, it MUST be treated as if it were not specified at all.
9595

@@ -118,11 +118,11 @@ producing invalid Unicode data.
118118
Drivers MUST implement truncation naively by simply truncating the output at the required length; i.e.
119119
do not attempt to implement truncation such that the output is still valid JSON.
120120
Truncated extended JSON MUST have a trailing ellipsis ``...`` appended to indicate to the user that
121-
truncation occurred. The ellipsis MUST NOT count toward the the max length.
121+
truncation occurred. The ellipsis MUST NOT count toward the max length.
122122

123123
**Fallback Implementation method**: Environment variable ``MONGOB_LOG_MAX_DOCUMENT_LENGTH``.
124124
When unspecified, any extended JSON representation of a document which is longer than the
125-
default max length MUST be truncated to that length.
125+
default max length MUST be truncated to that length.
126126
When set to an integer value, any extended JSON document longer than that value MUST be
127127
truncated to that length.
128128
If the variable is set to an invalid value, it MUST be treated as if it were not specified at
@@ -149,7 +149,7 @@ driver-specific messages they produce.
149149
- Environment Variable
150150

151151
* - command
152-
- `Command Monitoring <../command-monitoring/command-monitoring.rst>`__
152+
- `Command Logging and Monitoring <../command-logging-and-monitoring/command-logging-and-monitoring.rst>`__
153153
- ``MONGODB_LOG_COMMAND``
154154

155155
* - topology
@@ -263,7 +263,7 @@ SHOULD utilize it to support both types of logging.
263263

264264
Note that drivers implementing unstructured logging MUST still support some internal way to intercept
265265
the data contained in messages in a structured form, as this is required to implement the unified tests
266-
for logging conformance.. See the `unified test format specification
266+
for logging conformance. See the `unified test format specification
267267
<../unified-test-format/unified-test-format.rst#expectedLogMessage>`_ for details.
268268

269269
Representing Documents in Log Messages
@@ -277,7 +277,7 @@ Drivers MAY represent errors in log messages in whatever format is idiomatic for
277277
existing error types. For example, if a driver's error classes have existing ``toString()``
278278
implementations, those MAY be used. Alternatively, if a driver emits structured log messages, a
279279
structured format containing error data could be used. Any information which a driver reports via
280-
its error classes MUST be included in the log representations.
280+
its error classes MUST be included in the log representations.
281281
Note that if the driver includes full server responses in its errors these MUST be truncated in
282282
accordance with the max document length option.
283283

@@ -286,7 +286,7 @@ Omitting Null Values from Log Messages
286286
Some log messages will include fields that are only present under particular circumstances, for example
287287
on certain server versions. When such a field is not present:
288288

289-
- If the driver does structured logging, the field MUST be omitted from the message altogether, i.e. the field
289+
- If the driver does structured logging, the field MUST be omitted from the message altogether, i.e. the field
290290
MUST not be present with an explicit null value.
291291
- If the driver does unstructured logging, the corresponding segment of the message string MUST be omitted
292292
altogether.
@@ -296,8 +296,8 @@ Performance Considerations
296296
The computation required to generate certain log messages can be significant, e.g. if extended
297297
JSON serialization is required. If possible, drivers SHOULD check whether a log message would
298298
actually be emitted and consumed based on the users' configuration before doing such computation.
299-
For example, this can be checked in Rust via `log::log_enabled
300-
<https://docs.rs/log/latest/log/macro.log_enabled.html>`_.
299+
For example, this can be checked in Rust via `log::log_enabled
300+
<https://docs.rs/log/latest/log/macro.log_enabled.html>`_.
301301

302302
Drivers SHOULD optimize extended JSON generation to avoid generating JSON strings longer than will
303303
be emitted, such that the complexity is O(N) where N = ``<max document length>``, rather than
@@ -344,7 +344,7 @@ Design Rationale
344344
Truncation of large documents
345345
-----------------------------
346346

347-
1. Why have an option?
347+
1. Why have an option?
348348
We considered a number of approaches for dealing with documents of potentially very large size
349349
in log messages, e.g. command documents, including 1) always logging the full document, 2) only
350350
logging documents with the potential to be large when the user opts in, and 3) truncating large
@@ -354,10 +354,10 @@ Truncation of large documents
354354
will show the user the full data. In the case where data is large, the user will receive a
355355
readable message with truncated data, but have the option to see more or all of the data.
356356

357-
2. Why are the units for max document length flexible?
357+
2. Why are the units for max document length flexible?
358358
String APIs vary across languages, and not all drivers will be able to easily and efficiently
359359
truncate strings in the same exact manner. The important thing is that the option exists and
360-
that its default value is reasonable, and for all possible unit choices (byte, code point,
360+
that its default value is reasonable, and for all possible unit choices (byte, code point,
361361
code unit, or grapheme) we felt 1000 was a reasonable default. See
362362
`here <https://exploringjs.com/impatient-js/ch_unicode.html>`_ for a helpful primer on related
363363
Unicode concepts.

source/retryable-reads/retryable-reads.rst

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -446,15 +446,16 @@ Command Monitoring
446446
447447
`As with retryable writes
448448
<https://github.com/mongodb/specifications/blob/master/source/retryable-writes/retryable-writes.rst#command-monitoring>`__,
449-
in accordance with the `Command Monitoring
450-
<https://github.com/mongodb/specifications/blob/master/source/command-monitoring/command-monitoring.rst>`__
449+
in accordance with the `Command Logging and Monitoring
450+
<https://github.com/mongodb/specifications/blob/master/source/command-logging-and-monitoring/command-logging-and-monitoring.rst>`__
451451
specification, drivers MUST guarantee that each ``CommandStartedEvent`` has
452-
either a correlating ``CommandSucceededEvent`` or ``CommandFailedEvent``. If the
453-
first attempt of a retryable read operation encounters a retryable error,
454-
drivers MUST fire a ``CommandFailedEvent`` for the retryable error and fire a
455-
separate ``CommandStartedEvent`` when executing the subsequent retry
456-
attempt. Note that the second ``CommandStartedEvent`` may have a different
457-
``connectionId``, since a server is reselected for a retry attempt.
452+
either a correlating ``CommandSucceededEvent`` or ``CommandFailedEvent`` and that
453+
every "command started" log message has either a correlating "command succeeded"
454+
log message or "command failed" log message. If the first attempt of a retryable
455+
read operation encounters a retryable error, drivers MUST fire a ``CommandFailedEvent`` and emit a "command failed" log message
456+
for the retryable error and fire a separate ``CommandStartedEvent``and emit a separate "command started" log message when executing
457+
the subsequent retry attempt. Note that the second ``CommandStartedEvent`` and "command started" log message may have
458+
a different ``connectionId``, since a server is reselected for a retry attempt.
458459
459460
Documentation
460461
-------------
@@ -678,6 +679,7 @@ degraded performance can simply disable ``retryableReads``.
678679
Changelog
679680
=========
680681
682+
:2022-11-09: CLAM must apply both events and log messages.
681683
:2022-10-18: When CSOT is enabled multiple retry attempts may occur.
682684
:2022-10-05: Remove spec front matter, move footnote, and reformat changelog.
683685
:2022-01-25: Note that drivers should retry handshake network failures.

source/retryable-writes/retryable-writes.rst

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -533,22 +533,23 @@ specification does not define a format for such log messages.
533533
Command Monitoring
534534
==================
535535
536-
In accordance with the `Command Monitoring`_ specification, drivers MUST
536+
In accordance with the `Command Logging and Monitoring`_ specification, drivers MUST
537537
guarantee that each ``CommandStartedEvent`` has either a correlating
538-
``CommandSucceededEvent`` or ``CommandFailedEvent``. If the first attempt of a
539-
retryable write operation encounters a retryable error, drivers MUST fire a
540-
``CommandFailedEvent`` for the retryable error and fire a separate
541-
``CommandStartedEvent`` when executing the subsequent retry attempt. Note that
542-
the second ``CommandStartedEvent`` may have a different ``connectionId``, since
538+
``CommandSucceededEvent`` or ``CommandFailedEvent`` and that every "command started"
539+
log message has either a correlating "command succeeded" log message or "command failed"
540+
log message. If the first attempt of a retryable write operation encounters a retryable
541+
error, drivers MUST fire a ``CommandFailedEvent`` and emit a "command failed" log message for the retryable error and fire a
542+
separate ``CommandStartedEvent`` and "command succeeded" log message when executing the subsequent retry attempt. Note that
543+
the second ``CommandStartedEvent`` and "command succeeded" log message may have a different ``connectionId``, since
543544
a writable server is reselected for the retry attempt.
544545
545-
.. _Command Monitoring: ../command-monitoring/command-monitoring.rst
546+
.. _Command Logging and Monitoring: ../command-logging-and-monitoring/command-logging-and-monitoring.rst
546547
547548
Each attempt of a retryable write operation SHOULD report a different
548549
``requestId`` so that events for each attempt can be properly correlated with
549550
one another.
550551
551-
The `Command Monitoring`_ specification states that the ``operationId`` field is
552+
The `Command Logging and Monitoring`_ specification states that the ``operationId`` field is
552553
a driver-generated, 64-bit integer and may be "used to link events together such
553554
as bulk write operations." Each attempt of a retryable write operation SHOULD
554555
report the same ``operationId``; however, drivers SHOULD NOT use the
@@ -809,6 +810,7 @@ inconsistent with the server and potentially confusing to developers.
809810
Changelog
810811
=========
811812
813+
:2022-11-09: CLAM must apply both events and log messages.
812814
:2022-10-18: When CSOT is enabled multiple retry attempts may occur.
813815
:2022-10-05: Remove spec front matter and reformat changelog.
814816
:2022-01-25: Note that drivers should retry handshake network failures.

source/retryable-writes/tests/README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,11 +291,11 @@ Command Construction Tests
291291

292292
Drivers should also assert that command documents are properly constructed with
293293
or without a transaction ID, depending on whether the write operation is
294-
supported. `Command Monitoring`_ may be used to check for the presence of a
294+
supported. `Command Logging and Monitoring`_ may be used to check for the presence of a
295295
``txnNumber`` field in the command document. Note that command documents may
296296
always include an ``lsid`` field per the `Driver Session`_ specification.
297297

298-
.. _Command Monitoring: ../../command-monitoring/command-monitoring.rst
298+
.. _Command Logging and Monitoring: ../../command-logging-and-monitoring/command-logging-and-monitoring.rst
299299
.. _Driver Session: ../../sessions/driver-sessions.rst
300300

301301
These tests may be run against both a replica set and shard cluster.

0 commit comments

Comments
 (0)