Uploaded image for project: 'PHP Driver: Library'
  1. PHP Driver: Library
  2. PHPLIB-361

Implicit session for change stream should default causalConsistency to false

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.4.0
    • Affects Version/s: 1.3.2
    • Component/s: None
    • None

      Since PHPLIB-342, we create an "implicit from the user's perspective" session when a change stream is constructed without an explicit session. Since we do not specify any options when calling Manager::startSession(), this session defaults causalConsistency to true, which results in a ReadConcern being appended to outgoing commands. Since this session is only used for reading, it makes little sense to specify this option. Furthermore, a truly implicit session would never have causalConsistency enabled.

      I'll also note that libmongoc defaults causalConsistency to false when creating an implicit session for use with change streams. See: https://github.com/mongodb/mongo-c-driver/blob/1.11.0/src/libmongoc/src/mongoc/mongoc-change-stream.c#L219

            Assignee:
            jmikola@mongodb.com Jeremy Mikola
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: