Support snapshot read with an external provided timestamp

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Critical - P2
    • None
    • Affects Version/s: 3.5.0
    • Component/s: Read Operations
    • None
    • None
    • Dotnet Drivers
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      We have a use case in which we want to read consistency data between service calls.

      For example:

      • Service A calls Service B.
        • Service B returns the data from MongoDB and the session timestamp.
      • Service A then processes the data.
      • Possible: Service C changes the data in MongoDB.
      • Service A then calls Service B again, this time with the session timestamp from the first call.
        • Service B returns the data from MongoDB with the provided session timestamp, excluding changed data from Service C.

      Note: We ensure that the time between the two read operations is short enough for Mongo to provide the data.

      This solution was proposed by our MongoDB consultant.

      Currently, we use the following code to set the snapshot time for the read operation:

      session = await _mongoClient.StartSessionAsync(new ClientSessionOptions() { Snapshot = true }, cancellationToken);            session.WrappedCoreSession.SetSnapshotTimeIfNeeded(snapshotTimestamp.BsonTimestamp); 

      This code uses the internals of the MongoDB driver, and there have been discussions to remove the WrappedCoreSession property.

       

      We need an officially supported way to read snapshots with an externally provided timestamp.

              Assignee:
              Unassigned
              Reporter:
              Christoph Schnuck
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: