@@ -90,6 +90,11 @@ with sessions.
9090
9191Any network exception writing to or reading from a socket (e.g. a socket timeout or error).
9292
93+ ** SDAM**
94+
95+ An abbreviated form of "Server Discovery and Monitoring", specification defined in
96+ [ Server Discovery and Monitoring Specification] ( ../server-discovery-and-monitoring/server-discovery-and-monitoring.md ) .
97+
9398## Specification
9499
95100Drivers currently have no concept of a session. The driver API will be expanded to provide a way for applications to
@@ -710,7 +715,8 @@ expiration.
710715
711716## Gossipping the cluster time
712717
713- Drivers MUST gossip the cluster time when connected to a deployment that uses cluster times.
718+ Drivers MUST gossip the cluster time when connected to a deployment that uses cluster times. However, drivers MUST NOT
719+ gossip cluster time on SDAM commands.
714720
715721Gossipping the cluster time is a process in which the driver participates in distributing the logical cluster time in a
716722deployment. Drivers learn the current cluster time (from a particular server's perspective) in responses they receive
@@ -722,7 +728,7 @@ received from a server.
722728
723729### Receiving the current cluster time
724730
725- Drivers MUST examine all responses from the server commands to see if they contain a top level field named
731+ Drivers MUST examine all non-SDAM responses from the server commands to see if they contain a top level field named
726732` $clusterTime ` formatted as follows:
727733
728734``` typescript
@@ -748,8 +754,9 @@ not participate in the comparison.
748754
749755### Sending the highest seen cluster time
750756
751- Whenever a driver sends a command to a server it MUST include the highest seen cluster time in a top level field called
752- ` $clusterTime ` , in the same format as it was received in (but see Gossipping with mixed server versions below).
757+ Whenever a driver sends a non-SDAM command to a server it MUST include the highest seen cluster time in a top level
758+ field called ` $clusterTime ` , in the same format as it was received in (but see Gossipping with mixed server versions
759+ below).
753760
754761### How to compute the ` $clusterTime ` to send to a server
755762
@@ -791,6 +798,15 @@ the command. A server supports `$clusterTime` when the `maxWireVersion` >= 6.
791798
792799This supports the (presumably short lived) scenario where not all servers have been upgraded to 3.6.
793800
801+ ### Do not gossip on SDAM commands
802+
803+ Drivers MUST NOT gossip cluster time on SDAM commands. In earlier versions of this spec, drivers did gossip cluster time
804+ on SDAM commands, however it was discovered that doing so provides little benefit and can result in a loss of
805+ availability. For example, if the driver attempts to connect to a member of a different replica set, the driver can end
806+ up with an invalid cluster time. Worse, this invalid cluster time may remain the highest for an indefinite time since
807+ clocks between different clusters are not synced. This results in all operations failing until the application is
808+ restarted. To fix this issue we decided it was more robust to stop gossiping on SDAM commands altogether.
809+
794810## Test Plan
795811
796812See the [ README] ( tests/README.md ) for tests.
@@ -918,6 +934,7 @@ has risks that do not justify the potential guaranteed `ServerSession` allocatio
918934
919935## Changelog
920936
937+ - 2025-02-24: Drivers MUST NOT gossip $clusterTime on SDAM commands.
921938- 2024-05-08: Migrated from reStructuredText to Markdown.
922939- 2017-09-13: If causalConsistency option is omitted assume true
923940- 2017-09-16: Omit session ID when opening and authenticating a connection
0 commit comments