[CSHARP-2219] ClusterClockAdvancingCoreSession should return the greater of the two ClusterTimes Created: 19/Mar/18  Updated: 28/Oct/23  Resolved: 21/Mar/18

Status: Closed
Project: C# Driver
Component/s: Connectivity
Affects Version/s: 2.5
Fix Version/s: 2.7.0

Type: Bug Priority: Minor - P4
Reporter: Robert Stam Assignee: Robert Stam
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

As part of gossiping the cluster time the driver appends a $clusterTime element to the command sent to the server.

The code in CommandUsingCommandMessageWireProtocol looks like this:

var clusterTimeElement = new BsonElement("$clusterTime", _session.ClusterTime);
extraElements.Add(clusterTimeElement);

The driver is supposed to send the greater of the session's ClusterTime and the cluster's ClusterTime. The line of code as written above assumes that the _session value is an instance of ClusterClockAdvancingClusterTime and that ClusterClockAdvancingClusterTime will be the one to compare the two ClusterTimes and return the greater of the two.

The current implementation of ClusterClockAdvancingClusterTime neglected to do that.

ClusterClockAdvancingClusterTime needs to override the ClusterTime property to return the greater of the two ClusterTimes.



 Comments   
Comment by Githook User [ 21/Mar/18 ]

Author:

{'email': 'robert@robertstam.org', 'name': 'rstam', 'username': 'rstam'}

Message: CSHARP-2219: ClusterClockAdvancingCoreSession should return the greater of the two ClusterTimes
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/1b637efa7cb491ba967f315de02e8a7d2c92d4eb

Generated at Wed Feb 07 21:41:56 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.