Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRIVERS-2798 Drivers do not gossip $clusterTime on SDAM commands #1735

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ShaneHarvey
Copy link
Member

Please complete the following before merging:

  • Update changelog.
  • Test changes in at least one language driver.
  • Test these changes against all server versions and topologies (including standalone, replica set, sharded
    clusters, and serverless).

@ShaneHarvey ShaneHarvey requested a review from a team as a code owner November 22, 2024 00:07
@ShaneHarvey ShaneHarvey requested review from qingyang-hu, jyemin and a team and removed request for a team November 22, 2024 00:07
@@ -710,7 +710,8 @@ expiration.

## Gossipping the cluster time

Drivers MUST gossip the cluster time when connected to a deployment that uses cluster times.
Drivers MUST gossip the cluster time when connected to a deployment that uses cluster times. However, drivers MUST NOT
gossip cluster time on SDAM commands.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this link to the SDAM spec in some way, so that it's clear what SDAM commands refers to?

Copy link
Member Author

Choose a reason for hiding this comment

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

I followed the pattern in the load balancer spec and added "SDAM" to the terms section.

@@ -238,6 +238,20 @@ and configure a `MongoClient` with default options.
- Attempt to send a write command to the server (e.g., `insertOne`) with the explicit session passed in
- Assert that a client-side error is generated indicating that sessions are not supported

### 20. Drivers do not gossip `$clusterTime` on SDAM commands.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm unsure about this test. Previously we didn't have a test that asserts that cluster time is gossiped by SDAM commands. And now we have a test that it is not. When we fixed this issue in the java driver we didn't end up adding an integration test for it, because it was fixed by design: in the Java driver in order to gossip cluster time you need access to the client-wide instance of ClusterClock. In the fix we just removed the ClusterClock from the server monitor, so there in way it could unintentionally gossip.

That said, for other drivers I guess this test might be a useful one, so if you want to leave it I'm ok with that.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd prefer to keep the test. It does provide some value and it at least saves implementors' time trying to answer "how should I test this? Can I even test it?".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants