Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-2219

ClusterClockAdvancingCoreSession should return the greater of the two ClusterTimes

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.7.0
    • Affects Version/s: 2.5
    • Component/s: Connectivity
    • Labels:
      None

      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.

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            robert@mongodb.com Robert Stam
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: