Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-3392

Implement Snapshot Read functionality

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0.0
    • Component/s: None
    • Labels:
      None
    • Documentation Changes:
      Not Needed

      Description

      Acceptance Criteria

      • Pull in all the new spec tests and check for failures.
      • Implement the base snapshot sessions functionality according to the spec
        • Introduce `snapshot` session option for use in `client.startSession` (optional, default false)
        • Driver should raise error if `snapshot` and `causalConsistency` are both set to `true`
          • Should add unit test
        • Driver should raise error if `snapshot` is `true` and `session.startTransaction` is invoked
          • Should add unit test
        • ReadConcernLevel enum updated to include "snapshot"
          • NOTE: this already exists in the driver
        • Implement snapshot functionality for the following commands: `find`, `aggregate`, `distinct`
          1. Specify read concern `level: 'snapshot'` with the command; save the `atClusterTime` returned by 5.0+ servers for the first find/aggregate/distinct operation in a private property `snapshotTime` of the `ClientSession` object
          2. Pass that `snapshotTime` in the `atClusterTime` field of the `readConcern` field
            for subsequent snapshot read operations (for find/aggregate/distinct commands).
      • Newly added spec tests should pass

      Not required for this ticket:

      • Raising a client-side error when attempting to use a snapshot session with server versions < 5.0 (NODE-3394)
      • Sending readconcern with `snapshot` and `atCluserTime` properties on all snapshot session operations, even writes (NODE-3393)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              neal.beeken Neal Beeken
              Reporter:
              alexander.golin Alexander Golin
              Implementer:
              Daria Pardue Daria Pardue
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: